# For each row

> Repeat the steps that follow once for every matching row.

Source: https://docs.buildcord.dev/nodes/variables-and-data/for-each-row/

`data.each` loops over the rows of a collection.

## Settings

| Setting | What it does |
| --- | --- |
| Collection | The collection to loop over. |
| Where | A condition. Empty matches every row. |
| Sorted by | A column, then `desc` for largest first. |
| At most | The most rows to visit. Enter 0 for every match, up to 500. |
| Read the row as | The name to read each row under. The default is `row`. |

## Ways out

| Way out | Taken when |
| --- | --- |
| `Each row` | Once for each row. Wire it to the steps to repeat. |
| `When finished` | After the last row. |

## Produces

The row's columns as `{row.column}`, and `{loop.index}`, which row this pass is for, starting at 1.

## Notes

- A path inside the loop that leads nowhere returns to the loop for the next row.
- Use [Stop a loop](https://docs.buildcord.dev/nodes/flow-control/stop-loop) to leave early.

## Example

On a daily schedule, loop over giveaway entries where `status = open` and message each winner.

## Related

- [Find rows](https://docs.buildcord.dev/nodes/variables-and-data/find-rows)
- [Run a loop](https://docs.buildcord.dev/nodes/flow-control/loop)
