Loop For Module
Last updated
Last updated
The "Loop For" tool module, a default module to be used in any flow, was created to meet the need for processing data lists. It consists of two operations, Begin and End, which mark, respectively, the beginning and the end of a loop, based on an array that you must provide in JSON format.
The first operation (Begin) only takes as argument a list or array and derives the 3 FOR statements from that list. This type of statement is also known as For Each in some languages, and can be represented as follows:
To represent the loop_counter and the above code element in the platform, the Begin operation from the For module initializes and holds two equivalent parameters, which can be accessed by any module connected to the flow:
loopCounter: stores the flow execution position, starting from the value "0" for the first execution and increasing it with each execution
element: stores the array element that is in the loopCounter position, and it is a convenient way to access the contents of each loop execution
The "Loop For" module appears in the Tools option of editing a flow. Right after the click to add it, opens the modal for configuration:
Fill in the required Loop For fields, where:
List (Array): here you can either drag a parameter from the previous operations or a flow parameter, as well as manually enter an array or create an SMOP operation ( icon);
Validate: validates the array, displaying the complete list that will be handled in the Data Preview area.
To finish configuring the module, click on "Save".
The "Loop For" module requires another module to be connected to it. See the example:
.