Loop Operations
Loop Map Operations
There are two Loop Map Operations: ForEach Loop and MapEach Loop:
| Map Operator | Description | Parameters | Output | ||||
|---|---|---|---|---|---|---|---|
ForEach Loop | Loops over a repeating record in the source document. Relationships defined within the ForEach Loop are evaluated at each iteration of the loop. There is no record in the target document. ForEach is typically used to flatten a source loop hierarchy. It cannot output a record. | Requires one input parameter and one optional parameter:
| None | ||||
MapEach Loop | Loops over a repeating record in the source document. Relationships defined within the MapEach Loop Map Operation are evaluated at each iteration of the loop. Each iteration of the loop will also produce an instance of the repeating record in the target document. | Requires one input parameter and one optional parameter:
| A record will be created in the target document. |
Loop Map Operations provide the following benefits:
-
When an input message contains repeating elements, a Loop Map Operation can be used to flatten the hierarchy in the output document.
-
When the goal is to perform data manipulation, like concatenating fields or applying a mathematical formula, a Loop Map Operation can use an expression and output the results.
-
A Loop Map Operation can filter an input document based on criteria and output the filtered data.
Scope
When a ForEach Loop or a MapEach Loop is added to the Transform Designer surface, Scope is created as indicated by the arrow
. By default, scope is set when a ForEach Loop or MapEach loop is added. To work in the parent scope, select the arrow to unset the scope
. To work within the scope of a Loop Map Operation, select the arrow to set scope
. When the scope is set, all items added to the Transform Designer surface will perform under the scope of that Loop Map Operation.
For details on working within the scope of a Loop Map Operation, refer to Working Within the Scope.
Examples
In This Section
See Also
© 2011 Microsoft Corporation. All rights reserved.