This block is responsible for iterating over a set of blocks given a condition that it will use to iterate.
To simplify, this block is an instruction that repeats until a specified condition is reached. In a loop structure, the loop asks a question. If the answer requires action, it is executed. This is achieved via a simple configuration, where you can tell how many times to iterate, or what to iterate through, or when should the iteration stop.
This block has a start and endpoints, indicating where it will enter and where it will finish. That's why you have 'START' and 'END' endpoints. You need to connect your blocks inside the loop between these endpoints. You also have the 'AFTER' endpoint, indicating where should it go after it finished executing your loop.
How to use it? Just drag-and-drop the following into your diagram:
Click the block to set its properties. You will need to select one of the following:
Repeat This Loop (Fixed Amount Of Times) If you need to loop a fixed amount of times, use the following option and set your value:
For instance, if you set it to 5, the loop will be executed 5 times.
Repeat Condition In case you need to examine some condition, while looping, and continue looping until the condition is TRUE, then use this option. You need to click the following button to set your loop condition:
You will see an editor where you can define your 'TRUE' condition for the loop to continue:
For instance, it could be something like this:
In the example above, the loop will be executed while Balance Due is less than 500. If it's more, then the loop will end.
Loop Via Data Array This option is handy if you have data access as a previous block, and it can contain a list of records that you may want to iterate inside your loop. If that's the case, use the following option and select your data source from a previous step (if you have it, otherwise you cannot use this option):
What will happen after this block is executed? It executes the loop as many times as the condition tells it to. If successfully executed the loop condition, it will exit the loop and continue to the block which is linked with the 'AFTER' endpoint.
Possible Issues: It is possible to create an infinite loop. This should normally not happened, however, if it ever does happen, the system will try to pause and warn you.
Was this article helpful?
Would you like to get a beta invite?