Flow
flow/for_each
For Each
Iterates over every element in a list, firing the body output for each one.
Note: Use element and index outputs only from inside the body branch. They are only valid during that iteration.
Inputs
| Name | Type | Optional | Description |
|---|---|---|---|
exec |
exec | Starts the loop. | |
list |
list | The list to iterate over. |
Outputs
| Name | Type | Description |
|---|---|---|
body |
exec | Executed for each element in the list. |
done |
exec | Executed once after all elements have been processed. |
element |
any | The current element. |
index |
number | Current index (0-based). |
Examples
Message all online players
Send a message to every online player.
- Get Online Players → list
- Connect list → For Each
- Connect element (as player) → Player Message