Loop Do While Module
Last updated
Last updated
The "Loop Do While" tool module, standard module for use in any flow, was created to process external data related to the number of records, about which we have no a priori information. It is useful because we need to have one or more interactions to consume all the data in a flow, a process that is also known as paged reading.
The "Loop Do While" module consists of two operations, DO and WHILE, which mark the beginning and end of a loop respectively.
The structure of this type of loop can be represented as follows:
Note that the DO is initialized with a value of loop_count = -1, but the first instruction to be executed is its increment to "0". This maintains consistency with FOR, in which the first execution of the loop also has the value "0". In addition, as with FOR, the loop_count variable also contains the value of the number of executions minus one in the loop output.
To represent the loop_count , the DO operation of the Do While module initializes and maintains an equivalent parameter, which can be accessed by any module connected to the flow, called loopCount. This parameter stores the execution position of the flow, starting from the value "0" for the first execution, and incrementing it with each execution.
The "Loop Do While" module appears in the Tools option when editing a flow. As soon as you click to add it, the modal opens for configuration:
In the Create your conditional area, there are the following fields and options:
Satisfy all: if you want all the configured conditions to be followed;
Satisfy any: when it doesn't matter if all the configured conditions are met;
Conditions: comparisons between two values (equal to, different from, greater than, less than, etc);
Add condition: click to add another condition;
Validate: click to validate the conditions
Result: tells you whether the condition entered is true or false (True/False).
Parameter
The loopCount parameter of the DO operation is always available to any modules inside the loop and also after the loop has been executed, appearing on the left-hand side of the configuration modal of each operation in the flow, as long as the operations are all connected by lines in the flow.
After the loop has finished, the loopCount parameter will contain the total number of executions minus 1 (since the variable starts at 0).
To finish configuring the module, click on "Save".
The "Loop Do While" module requires another module to be connected to it. See the example:
.
Variable 1: type or drag a parameter from another flow component to enter a variable for comparison, or use a (on the icon);
Variable 2: type or drag a parameter from another flow component to enter another variable for comparison or use a (on the icon);