Field

A field is a subset of a data structure that represents a single data item. For example, a database table column is a field. Use this resource to request field details for a source or target object and to update the flat file attributes for a source or target object.

GET Request

To request the field details of a source object, use the source connection ID or source connection name and the source object name. Use one of the following URIs:

/api/v2/connection/source/<id>/field/<object name>
/api/v2/connection/source/name/<name>/field/<object name>

If you use the connection name in the URI and the connection name includes a space, replace the space with %20. For example:

/api/v2/connection/source/name/my%20connection/field/customer

To request the field details of a target object, use the target connection ID or target connection name and the target object name. Use one of the following URIs:

/api/v2/connection/target/<id>/field/<object name>
/api/v2/connection/target/name/<name>/field/<object name>

If you use the connection name in the URI and the connection name includes a space, replace the space with %20. For example:

/api/v2/connection/target/name/my%20connection/field/customer

You can also use the following URI, which accommodates searching for an object that includes a forward slash (/):

/api/v2/connection/<source or target>/<id>/fields?objectName=<objectName>

The object name is case-sensitive.

GET Response

Returns the field object for each field in the requested object.
Returns the error object if errors occur.
The field object includes different information based on the connection type. The following are the attributes of a field object:

FieldTypeDescription
idLongField ID.
nameStingField name.
typeStingField type.
labelStingField label.
parentObjectStingParent object, if applicable.
precisionIntLength of the field in bytes.
pcTypeStingPowerCenter data type.
scaleIntNumber of digits after the decimal point for numeric values.
columnIndexIntColumn index.
isKeyBooleanWhether the field is a used as a key.
isExternalIdBooleanWhether the field is used as an external ID.
isSfldLookupBooleanWhether the field is used as a Salesforce ID lookup field.
isNullibleBooleanWhether the field can contain null values.
isUniqueBooleanWhether the field requires unique values.
isCreateableBooleanWhether the field accepts new values.
isCalculatedBooleanWhether the field is calculated.
isUpdateableBooleanWhether the field allows updates.
isFilterableBooleanWhether the field can be filtered.
linkedFieldsStingFor a masking task, the source field mapped to the input field of the mapplet.
relatedInfosInformation about related fields included in a fieldRelatedInfo object for each related field.
fieldIdLongIncluded in the fieldRelatedInfo object.
Field ID.
referenceObjectStingIncluded in the fieldRelatedInfo object. Object that includes the field.
relationshipNameStingIncluded in the fieldRelatedInfo object. Relationship to object.
referencesReference information included in a fieldRelatedInfo object for each related field.
fieldIdLongIncluded in the fieldRelatedInfo object.
Field ID
referenceObjectStingIncluded in the fieldRelatedInfo object.
Object that includes the field
relationshipNameStingIncluded in the fieldRelatedInfo object.
Relationship to object.
javaTypeStingJava data type.
showLabelBooleanWhether to show the field label.
naturalOrderIntPosition number of the field in the source.
customPropertiesCustom properties for the field.

GET Example

To use XML to get the field details for the Customer object available through the source connection (ID: 0002D420000000J), you might use the following request:

GET <serverUrl>/api/v2/connection/source/0002D420000000J/field/Customer
Content-Type: application/xml
Accept: application/xml
icSessionId: <icSessionId>

A successful request returns the fields object for each field in the Customer source object.

POST Request

To update the flat file attributes for a source or target object, use one of the following URI:

/api/v2/connection/source/<id>/field/<objectName>
/api/v2/connection/target/<id>/field/<objectName>

The flat file attributes provided in the request override the default attributes specified in the connection object.
You can use the following attributes in the flatFileAttrs object:

FieldTypeRequiredDescription
idLongYesField ID.
delimiterStringYesCharacter used to separate fields.
textQualifierStringYesQuote character that defines the boundaries of text strings.
escapeCharStringYesCharacter immediately preceding a field delimiter character embedded in an unquoted string, or immediately preceding the quote character in a quoted string
headerLineNoIntYesNumber of header lines.
firstDataRowintYesThe row number where the data begins in the file.

POST Request Example

To send a request for field information, you might use the following request:

POST <serverUrl>/api/v2/connection/source/0000010B000000000021/field/test_precision.csv
1.0
Content-Type: application/xml
Accept: application/xml
icSessionId
{
    "@type": "flatFileAttrs",
    "delimiter": ",",
    "textQualifier": "'",
    "escapeChar": "\\"
}

POST Response

If successful, returns the connListItem object. Returns the error object if errors occur.