Mapping Editor
Mapping Editor is a tool that enables you to transform and map data with the help of output schema, various mapping types, functions, properties, and variables.
In Mapping Editor you work with input data and output data. Input data may come from various places and in different formats. Mapping editor’s task is to transform this data to the format expected in the output. Output data format is defined by Output Schema.
Mapping Editor provides four mapping types: Expression, Object Map, Array Map, and Array.
Expression
Expression mapping allows you to create complex mapping logic, make calculations, and transform data with the help of expressions. Use functions, properties, and variables combined with the logical operators to complete the task.
Object Map
Use Object Map to add an object type property. Each object type property may contain a number of nested properties. For each of those nested properties, you may use Object Map or Array Map to create a more complex nested structure or use Expression to map them.
To add an object type property, do the following:
- Add new or select an existing property in Output Schema.
- Select Object Map.
- Click + next to the property name to add a nested property.
Array Map
Array Map is used to create a new array of objects based on the existing one. Use Array Map to create an array of objects type property. Each array of objects type property contains List and Item. List is used to map the array and Item is used to configure the structure of objects in the array.
To create and map an array of objects property, do the following:
- Add new or select an existing property in Output Schema.
- Click Array Map.
- Map List to the array of objects property.
- Define the sctructure of the object inside the array by adding properties to Item with the help of Object Map. Use Expression to map those properties.
Mapping Examples
Example 1. Concatenate Two Properties
Task:
You have an object with FirstName, LastName, and Title properties. You want to receive an object with FullName and Title properties instead.
Solution:
- Сreate a FullName property in the Output Schema.
- Choose Expression mapping type and enter the following expression into expression editor:
FirstName + ' ' + LastName
.
Example 2. Nested Object Mapping
Task:
You have an object with OrderId, CustomerFirstName, and CustomerLastName properties. You want to receive an object with a different structure, where customer data is stored in a nested Customer object.
Solution:
- Create a Customer property in the Output Schema and choose Object Map.
- Click + next to Customer to add FirstName property to the Customer object.
- Click + next to Customer to add LastName property to the Customer object.
- Map LastName and FirstName properties to CustomerLastName and CustomerFirstName accordingly.
Example 3. Concatenate Two Properties in a Nested Object
Task:
You have an object with a nested Customer object with FirstName and LastName properties. You want to change the nested object structure to store the first and last name data in a FullName property.
Solution:
- Create a Customer property in the Output Schema and choose Object Map.
- Click + next to Customer to add FullName property to the Customer object.
- Click on FullName and choose Expression.
- Enter the following expression into expression editor:
Customer.FirstName + ' ' + Customer.LastName
.
Note that you should use Customer.FirstName instead of FirstName as you deal with a nested property.
Example 4. Concatenate Two Properties in Each Object in the Nested Array of Objects
Task:
You have an object with a Company property and a nested array of Contacts objects with FirstName, LastName, and Email properties. You want to receive an object with a different structure and different property names.
Solution:
- Create Account property in the Output Schema.
- Choose Expression and map Account to Company.
- Create Users property in the Output Schema and choose Array Map to make it a nested array of objects. List and Item will appear.
- Map List to Contacts array.
- Click + next to Item to add a FullName property.
- Click FullName property, choose Expression, and enter the following expression:
FirstName + ' ' + LastName
- Click + next to Item to add an Email property.
- Map Email to Email.