Loop
Loop
Repeats a block of actions a set number of times. On each pass the internal counter goes up, and it is available as an output to the actions inside.
Options
How many times to repeat?
How many times the inner block of actions runs. It has to be a whole number greater than zero. It takes a fixed value, another action's output, code or a variable.
Returns
Javascript code
js
actions["action-id"].count // the current iteration's number (number)
Field selection
- count — the current iteration's number, starting at
1and going up on each pass (number).
Rules and conditions
- How many times to repeat? is required and has to be greater than zero.
- The count output can be used by any action inside the loop's block to know which iteration the robot is on.
- To break out before every iteration has run, use Exit the loop.
- To skip to the next iteration without running the rest of the block, use Next iteration.
- To change the counter's value programmatically while it runs, use Change the loop counter.