Loop
Loop blocks let you iterate over a list of items. Only the Foreach loop type is supported. Open any automation in Automation from the top navigation and click Add Condition, Record or Action to add a loop block.
Using a loop
- Click Add Condition, Record or Action below any block.
- Select Loop.
- Set up the loop in the right panel.
Configuration
| Field | Description |
|---|---|
| Loop Type | The type of loop. Only Foreach is available. |
| Array Source | Select the array to iterate over. Must be an array variable available from a previous block (for example, a list returned by a Record block). |
| Item Alias | The name used to reference the current item in each iteration (for example, currentItem). Access fields using {{currentItem.field}}. |
Examples
Iterate over fetched records
If you have a block that fetches a list of users, you can use a loop to send an email to each user.
Loop: For each user in fetchedUsers
Action: Send Email
To: {{user.email}}
Subject: Hello!
Related
- Conditions — Add logic inside or outside loops
- Records — Fetch lists of records to iterate over