Loop node iterator lines, which indicate the source and target nodes whose mapped fields a transformation will iterate on, are generated automatically during the mapping process, either when using automapping or when manually mapping source objects to target fields.
Normally, the automatic generation of loop nodes during mapping is appropriate for the data set. However, when the data is such that there are multiple sets of repeating data values — or multiple loop nodes — you may need to manually define a loop node to force the data to loop on a different node. You can also, if needed, remove loop nodes, both those that have been manually defined and those that have been automatically generated.
Define a Loop Node Manually¶
Loop nodes can be defined manually on target nodes that meet both of these conditions:
- The cardinality of the target node must be
- There must not be any mappings on direct leaf fields within the target node.
In addition, the cardinality of the source node being used to create the target loop node must be
To define a loop node manually, in mapping mode, drag a qualifying source node to a qualifying target node:
On dropping the source node onto the target node, a menu appears. Select the option Define Loop Node:
The loop node is now defined, and the iterator line is displayed, indicating how the transformation will loop through the source data set. (The line is displayed even if there are not yet any direct leaf mappings on fields under the node.) Complete the mapping of fields beneath the loop node as usual:
Remove a Loop Node and Mappings¶
Options for removing a manually defined loop node or for removing any loop node and its mappings are available within a node's actions menu.
Remove Loop Node removes the loop node definition. This action is available only on nodes that have a manually defined loop node.
If you remove all of the direct leaf mappings of a manually defined loop node, the loop node definition still exists.
Remove Loop Node and Mappings removes the loop node definition due to mappings that are direct leaf children associated with the loop node, and removes those mappings.
Any other mappings within child loop nodes beneath the parent loop node are preserved, and the node retains its loop node definition if at least one grandchild is mapped.
This section describes an example, employing the HubSpot connector, that is a use case where redefinition of loop nodes is necessary. In this example, a request transformation provides filters to use in a HubSpot Search activity to query company records. Below, we first show the output when using the automatically generated loop node and then show how the output changes when the loop node is manually redefined.
Automatic Loop Node Generation¶
After automapping and automatic generation of a loop node, the transformation mapping shows data looping on the target's second
When the mapping above is processed using the below input data, it results in this output, which flattens the input structure into a single list of filters: