Mapping fields for add, or update or add only purposes
After uploading a .csv file to add, update, delete or perform some other operation (custom purpose for the import) on the data for a data type, map the fields in your data type with the fields in the .csv file.
In the Map fields step of the data import process, do the following steps:
- Select a template from the Template type list that you want to use to define the mapping between the fields in your data type and the fields in the .csv file.
- If you selected Add only as the import purpose, skip to step 6.
-
In the Match existing records by field, use the autocomplete control to enter the field in the .csv file that corresponds to the field in your data type that acts as a unique identifier (key). The field uniquely maps the data records for your data type with the records in the .csv file.
For example, you can map the Employee ID field in your Employee data type with the Staff ID field in the .csv file.
The system updates the Target field column (Employee ID) for the corresponding Source field column (Staff ID) and marks it as a record identifier in the Update type column.
- If the data type uses multiple keys, you must specify all the Match existing records by fields and their corresponding target fields in the .csv file. In this case, only the keys are listed in the autocomplete field.
- If the data type uses an autogenerated key, you can select any exposed property as the target field for the Match existing records by field that you select.
- Select Case insensitive matching if you want to ignore case when mapping fields.
-
If you want to use the same method to update data for all the fields in your data type, do the following steps, otherwise you will select the update method for each field in step 8:
- Select Update all fields.
-
Select the method that you want to use to update data from the
Update type
list.
- Select Always update if you want to update data for all the fields in your data type.
-
Select Update if target is blank if you want to update data for the empty fields in your data type.
For example, your Employee data type has the following data for Employee ID 123:
- Name : John
- Age :
The .csv file has the following records for Staff ID 123 (mapped to the Employee ID field):
- Name : Peter
- Age : 30
After importing the .csv file, your Employee data type has the following data for Employee ID 123:
- Name : John
- Age : 30
-
Select Update if source is not blank if you want to update data for the fields in your data type that correspond to non-empty fields in the .csv file.
For example, your Employee data type has the following data for Employee ID 123:
- Name : John
- Age : 30
The .csv file has the following records for Staff ID 123 (mapped to the Employee ID field):
- Name : Peter
- Age :
After importing the .csv file, your Employee data type has the following data for Employee ID 123:
- Name : Peter
- Age : 30
Note: The update methods are not applicable when you want to add data records to a data type. The system adds new records irrespective of the update method that you select. -
In the Target field column, select the fields in your data type corresponding to the fields in the .csv file that appear in the Source field column or click Select to display a dialog box for searching and filtering fields.
Note: You can select top level and embedded properties as targets for import. - If you want to map fields from an external system, you can apply business logic, such as lookups, decision trees, and decision tables to translate external data into fields that are understood by Pega Platform. In the Mapping options column, click the Mapping options icon to select which type of business logic to use for the translation and click Submit . See Transforming data during import for information about when and how to use the various business logic options.
- Enter a default value. For new records, the default value is used if the source field is blank. For existing records, the default value is used if both the source and target fields are blank. If you use a lookup, decision tree, or decision table, the source value is the value obtained from the lookup, tree, or table. It is not the value in the .csv file.
-
Set defaults for custom fields, that is, fields that do not have matching source columns in the .csv file.
- Click View custom defaults .
- Click Add default value .
- Enter the target field or click Select to choose the target field from a list of fields.
- Enter the default value. For new records, the default value is used if it is provided. For existing records, the default value is used if the target value is blank.
- Repeat steps 7c and 7d to add more fields.
- Click Next if you have finished mapping fields or click Back to mapping to finish mapping fields.
-
If you selected
Add only
as the import purpose and if you are not using the same method to update data for all the fields in your data type, select the method for each field from the
Update type
list.
Note: You cannot update this value for the field that is marked as a record identifier.
- Click Next.