A Custom Mapping transformation looks up each source value (input field value) in a custom mapping dictionary to find the target value (output field value). This custom mapping dictionary is defined in the transformation configuration, and makes it easy to create quick lookup tables for fixed value transformations.
Prerequisites
- You must have Manage Data Mappings permission.
- A syntactic mapping should have already been created.
Creating a Custom Mapping Transformation
To create a Custom Mapping transformation, complete the following steps.
Step 1: Open the Transformations Panel
- In the Syntactic Mappings page, choose the mapping you want to edit.
- Click the Edit Pencil in the Transformation field for the entry you would like to edit transformations for.
- The Transformations Panel will appear. Click the Add Transformation button.
- Click the dropdown menu to select the desired transformation type.
Select the Custom Mapping transformation.
Step 2: Fill in the Transformation Configuration
- Note the Source Input and Target Output. It should reflect what you already chose in the syntactic mapping entry.
- Add the custom mapping to the code section. The custom mapping can use one of two formats: CSV or JSON.
- CSV - the syntax is: input value,output value. Place each set of values on a separate line. For example:
m,Male
f,Female
o,Other - JSON - should be a valid JSON dictionary. For example:
{
"m": "Male",
"f": "Female",
"o": "Other"
}
- CSV - the syntax is: input value,output value. Place each set of values on a separate line. For example:
- Indicate what happens if the mapping from the source value is not found. You can choose to:
- Skip the row - this entire row will be omitted from the output table.
- Fail - the entire code run is failed.
- Use the source value - the output value will be set to the source value without any changes
- Set to default - set the output to a default value (e.g. "" or "0" or "MISSING"). If you select "Set to default", another input appears for you to fill in the desired default value.
4. When complete, click the Save button.
Ordering Transformations
When code runs, configured transformations are executed one after another. If you want to change the order of transformation execution for specific syntactic mapping entries, complete the following steps.
- In the Syntactic Mapping page, choose the mapping you want to modify.
- Select the Edit Pencil in the Transformation field for the entry you want to edit. The Transformations Panel will appear.
- Click the transformation's handle (six domino-looking dots), and drag the transformation in the order you want it to run. Do this for each transformation that you want to reorder.
- When done, click Save at the bottom of the page.
Editing a Transformation
To edit a transformation, complete the following steps.
- In the Syntactic Mappings page, select the mapping that you want to edit transformations for.
- Find the mapping entry you want to edit, then click the pencil icon in the Transformation column. The Transformations Panel will appear.
- Edit the transformation as desired.
- When complete, click the Save button.
Next Steps
Related Articles
- Creating a Syntactic Mapping
- Syntactic Mapping Transformations
- Removing a Syntactic Mapping
- Working with Syntactic Mapping Configurations in JSON Format