To create a destination object array that contains multiple objects, use the JSONPath notation $,$ to define the number of objects contained in the object array.
-
$,$ would create an object array with two objects
-
$,$,$ would create an object array with three objects
-
$,$,$,$,$ would create an object array with five objects
Each object in the array is represented as a tab at the top of Mapper 2.0, so that you can build unique mappings for each object in the object array. Any fields added to the first object in an array are automatically added to all subsequent objects in the array; however, you can modify each subsequent object independently if necessary by selecting the $ tab that represents the object.
For example, consider the following source data:
{ "source_field_1": "value_1", "source_field_2": "value_2", "source_field_3": "value_3" }
In the above JSON, the source object has three fields, each of which needs to rearranged into the following object array format before import into the destination application:
{ "destination_field_1": "value_1", "custom_fields": [ { "name": "destination_field_2", "value": "value_2" }, { "name": "destination_field_3", "value": "value_3" } ] }
This JSON format has a custom_fields object array that contains two objects. Use the following steps to generate the above destination JSON structure from the source data using Mapper 2.0:
Destination (left column) |
Source (right column) |
---|---|
|
|
|
|
|
|
Mappings for the first object in the custom_fields object array |
|
|
|
|
|
Mappings for the second object in the custom_fields object array |
|
|
|
Comments
Please sign in to leave a comment.