Skip to main content Skip to complementary content

FlatToHierarchyLoop

Creates a loop with nested recursive elements based on their level in a flat set of input elements.

This function allows you to create nested recursive elements in the output based on a level number in the input.

To illustrate, if the level number is always one, this functions identically to the SimpleLoop function. When the level number is 2, a nested element (that is the same as the enclosing output element) is emitted. For each increment of the level number a new level of nesting is created. It is assumed that the level number will increase and decrease monotonically over the input.

This function can only be used in the Loop tab.

Arguments

Input Map Element Add a map element from the input structure.
Level Number Specify the level of the element in the output structure.
Filter Specify an expression that returns a Boolean. This expression is evaluated for each instance of the loop. If this filter expression returns true, the instance is included in the loop. If it returns false, the instance is excluded from the loop.
Sort Keys Use the AscendingSort or DescendingSort function to sort loop iterations. You can use as many as needed.
Contexts Specify the context using the EnclosingContext or NestedContext function. EnclosingContext specifies the output map element that encloses this loop. If not specified, the nearest looping ancestor map element is used.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!