Mapping Hierarchical Data Fields

When mapping hierarchical data, the type of relationships in the source data and the Blocks selected for the Map determine which fields can be mapped.

A parent entity can contain children that are a one-to-one relationship, such as a SalesOrder with a Contact and a Shipping Address. Fields for both the parent and the child display on the Block Properties Preview Tab for a Query or a Fetch Block, and on the Block Properties Fields Tab for target Blocks, such as the CreateWith Block, the UpdateWith Block, or the UpsertWith Block.

A parent entity can also contain children that are a collection or a one-to-many relationship, such as a SalesOrder with several Items. Fields for the parent display on the Block Properties Preview Tab for a Query or a Fetch Block, and on the Block Properties Fields Tab for target Blocks, such asthe CreateWith Block, the UpdateWith Block, or the UpsertWith Block. To access the fields for the children on the source side, you must use a For Each Child Block. To map fields for child records on the target side, you must use an Add Block.

SalesOrder Example

Assume you need to query the SalesOrder mentioned above and write the data to a target datastore. The images below show how the entities and fields display.

Sample SalesOrder

The Fields Tab for the CreateWith Block contains the order information and the shipping information, but does not contain the items in the order.

Fields Tab With Parent Entity And Single Child Entity

To access the fields for the Items, add a For Each Child Block inside the CreateWith Block. To add the fields for the Items to the target, place an Add Block inside the For Each Child Block.

Sample Map To Write Multiple Children

The Fields tab on the Add Block contains the fields for the parent entity, the single child entities, and the Items in the SalesOrder.

Fields Tab With One-To-Many Children

Related Topics

Working With Blocks

Mapping Blocks

CreateWith Block

UpdateWith Block

UpsertWith Block

Add Block