Tasks > Synchronization tasks > Field mappings
  

Field mappings

Configure field mappings in a synchronization task to map source columns to target columns.
Configure field mapping on the Field Mapping page of the synchronization task wizard.
You must map at least one source column to a target column. Map columns with compatible data types or create field expressions to convert data types appropriately.
Depending on the task operation, the synchronization task requires certain fields to be included in the field mapping. By default, the synchronization task maps the required fields. If you configure the field mapping, ensure that the required fields remain mapped. If you do not map the required fields, the synchronization task fails.
The following table shows the required fields for each applicable task operation for a database target:
Required field
Task operations
Description
Primary Keys
Delete
Update
Upsert
Map primary key columns to enable the synchronization task to identify records to delete, update, or upsert in a database target.
Non-null fields
Insert
Update
Upsert
Map all fields that cannot be null in database.
When you configure field mappings, you can also perform the following tasks:

Field data types

When you create a synchronization task, Data Integration assigns a data type to each field in the source and target. You can edit the field datatypes on the Field Mapping page of the synchronization task wizard. You can edit field data types for any source or target type except for Data Integration Connector sources and targets, and mapplets.

Mapplets in field mappings

You can add a mapplet to a field mapping. After you add a mapplet to a field mapping, you must map the source fields to the input fields of the mapplet and map the output fields of the mapplet to the target fields.
When a source field is mapped directly to a target field and you map an output field of a mapplet to the same target field, Data Integration concatenates the values of the source and output fields in the target field. Verify that the expression is correct for the target field.
Note: The names of the output fields of a mapplet do not match the source field names. Data Integration appends a number to the end of the source field name to determine the output field name. In addition, Data Integration may not display the output fields in the same order as the source fields.

Lookup conditions

A lookup returns values based on a lookup condition. You can create a lookup condition based on information in the source on the Field Mapping page of the synchronization task wizard. For example, for a SALES source database table, you might set the ITEM_ID column equal to ITEM_ID column in a ITEMS flat file, and have the lookup return the item name for each matching item ID.
When you create a lookup condition, you define the following components:

Lookup return values

When you configure a lookup, you configure a lookup return value. The lookup return value depends on the return value properties that you define, such as multiplicity or a lookup expression.
A lookup return value is the value that Data Integration returns when it finds a match based on the lookup condition. If the lookup returns an error, Data Integration writes the row to the error rows file.
You can configure a lookup expression as part of the lookup return value. Configure a simple expression that uses the $OutputField variable to represent the lookup return value.
For example, the following expression adds 100 to each lookup return value:
$OutputField+100
As another example, you can use the concatenate operator ( || ) to append a string to a string lookup return value as follows:
'Mighty' || '$OutputField'
You can use parameters defined in a parameter file in a lookup expression.
The following table describes the lookup return value properties that you can configure:
Lookup Return Value Property
Description
Output Field
The field from the lookup table that you want to use.
Multiplicity
How Data Integration handles multiple return values.
  • - Error If More Than 1 Output Value. Select if the synchronization task should display an error when the lookup condition returns multiple values. Data Integration rejects rows when multiple matches are found, writing them to the error rows file. This is the default.
  • - Randomly Pick 1 Output Value. Select if the synchronization task should choose the first returned value when a lookup condition returns multiple values. Different systems might use different orders to return lookup values.
Expression
A simple expression that uses $OutputField to represent the selected output field.
By default, Data Integration passes the lookup return value without alteration with the following expression: $OutputField.

Rules and guidelines for lookups

Use the following rules and guidelines when creating a lookup: