Run a loop
Repeat the steps that follow a set number of times, or once for each item in a list.
flow.loop repeats the steps wired to Each time, then continues from When finished. It can't fail.
No longer in the picker
Repeat and For each item each do one half of it, so a node never reads two ways at once. Flows that have this node keep working.
Settings
| Setting | What it does |
|---|---|
| Times | How many passes. The default is 3. The current pass is {loop.index}, starting at 1. |
| Or once for each item in | A list, such as {var.bannedWords}. When set, each item is {loop.item}, and blank items are skipped. |
| Items are separated by | Commas or New lines. |
Ways out
| Way out | Taken when |
|---|---|
Each time | For every pass. Wire it to the steps to repeat. |
When finished | After the last pass. |
Produces
{loop.index}, and {loop.item} when you give a list.
Notes
- A path inside the loop that leads nowhere returns control to the loop for its next pass.
- Use Stop a loop to leave early.
- To loop over rows of a collection, use For each row.
Example
Check a message against each word in {var.bannedWords} and stop the loop at the first match.