For Loop
For Loop
Section titled “For Loop”Type: for-loop · Package: Core Activities v1.0.0
Repeats a block of activities a counted number of times, keeping a numerical rate that increases with each round. Use it when you know how many times to loop (scroll 10 pages, generate 5 reports) and you’re not looping through the elements of a collection.
How it works
Section titled “How it works”Count from from (included) to to (excluded), adding step on each lap. In each iteration it saves the current value in the variable indexVariable and executes activities.
from = 0, to = 3, step = 1 → índice toma 0, 1, 2 (3 vueltas; el 3 NO se ejecuta)from = 1, to = 11, step = 1 → índice toma 1, 2, …, 10 (10 vueltas)from = 0, to = 10, step = 2 → índice toma 0, 2, 4, 6, 8Supports Break and Continue inside the body.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
from | number | Initial index (included). |
to | number | End Index (excluded): The loop runs as long as index < to. |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
step | number | How much the index increases per lap. By default 1. |
indexVariable | nombre de variable | Variable with the current index. By default i. |
Subflows (lanes)
Section titled “Subflows (lanes)”activities requerido
Section titled “activities requerido”Activities that are executed in each lap.
Example
Section titled “Example”Go through the first 5 pages of a web listing:
For Loop from = 1 to = 6 indexVariable = pagina └─ activities: Page Navigate url = = "https://erp.cliente.com/listdo?page=" + pagina Log level = info message = = "Procesando página " + pagina