Flow.Documentation
BeginnerWorkflows

Loop: repeat for every item

7 steps± 5 minVideoVerified 22 Oct 2026
  1. Step 1 · Open Flow and create a workflow
  2. Step 2 · An order with lines
  3. Step 3 · Start at zero
  4. Step 4 · Add the loop
  5. Step 5 · Add up, per line
  6. Step 6 · Put the steps in one line and save
  7. Step 7 · Run

An order has lines, an export has rows, an API returns a list. With a Loop you run the same steps for every item in such a list. What a step inside the loop changes is kept for the next pass: that is how you add up or keep track of what you came across.

Watch the whole guide as a video7 steps in one film
Step 1 / 7

Open Flow and create a workflow

In the portal, under Environments, click Development and there Open; Flow opens in a new tab. There, click + next to General, choose New workflow and give it a name. A new workflow starts with an Event trigger: the point where it begins.

  1. Click Development
Open Flow and create a workflow · Click Development
  1. Click Open ↗
Open Flow and create a workflow · Click Open ↗
  1. Click Add to General
Open Flow and create a workflow · Click Add to General
  1. Click New workflow
Open Flow and create a workflow · Click New workflow
  1. In Workflow name, type Guide · add up order lines
Open Flow and create a workflow · In Workflow name, type Guide · add up order lines
Step 2 / 7

An order with lines

Put an order with a list of lines under the trigger's Sample data (Code). A list is between [ ].

  1. Click the step ‘Event trigger’
An order with lines · Click the step ‘Event trigger’
  1. Click Code
An order with lines · Click Code
  1. In the sample data, type `{
An order with lines · In the sample data, type `{; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
Step 3 / 7

Start at zero

Add Transform data with a field total = 0. That is the counter the loop adds to in a moment; without a starting value the field does not exist on the first pass.

  1. Click Add node
Start at zero · Click Add node
  1. Click Transform data
Start at zero · Click Transform data
  1. In Name, type Start at zero
Start at zero · In Name, type Start at zero
  1. Click Remove field
Start at zero · Click Remove field
  1. Click Remove field
Start at zero · Click Remove field
  1. In New field, type total
  2. In total, type = 0
Start at zero · In New field, type total; In total, type = 0
  1. Click the dot of ‘Event trigger’
Start at zero · Click the dot of ‘Event trigger’
  1. Click the dot of ‘Start at zero’
Start at zero · Click the dot of ‘Start at zero’
Step 4 / 7

Add the loop

Choose Loop in the library. Under Which list you type the name of the list (without {{ }}), and you give the current item a name: line. In the steps inside the loop you read the item as {{line.price}}.

  1. Click Add node
Add the loop · Click Add node
  1. Click Loop
Add the loop · Click Loop
  1. In Name, type Per line
  2. In Which list do you want to process? The list comes from the previous node., type lines
  3. In Name of the current item Steps read the item as {{line.naam}}., type line
Add the loop · In Name, type Per line; In Which list do you want to process? The list comes from the previous node., type lines; In Name of the current item Steps read the item as {{line.naam}}., type line
  1. Click the dot of ‘Start at zero’
Add the loop · Click the dot of ‘Start at zero’
  1. Click the dot of ‘Per line’
Add the loop · Click the dot of ‘Per line’
Step 5 / 7

Add up, per line

At the bottom of the loop, choose Transform data under Add step: it lands in the loop's area and runs for every line. Set total to = round(total + line.quantity * line.price, 2): the previous total plus this line.

  1. In Add step, choose Transform data
Add up, per line · In Add step, choose Transform data
  1. In Name, type Add up
Add up, per line · In Name, type Add up
  1. Click Remove field
Add up, per line · Click Remove field
  1. Click Remove field
Add up, per line · Click Remove field
  1. In New field, type total
  2. In total, type = round(total + line.quantity * line.price, 2)
Add up, per line · In New field, type total; In total, type = round(total + line.quantity * line.price, 2)
Step 6 / 7

Put the steps in one line and save

Select the steps (click the first, and the others while holding Shift) and click Align horizontally: they then stand in one line and you read the workflow from left to right; a branch (such as No of an If / Else) gets its own row below. Fit to view puts everything in sight; then Save.

  1. Click ‘Event trigger’
Put the steps in one line and save · Click ‘Event trigger’
  1. Click ‘Start at zero’ while holding Shift
Put the steps in one line and save · Click ‘Start at zero’ while holding Shift
  1. Click ‘Per line’ while holding Shift
Put the steps in one line and save · Click ‘Per line’ while holding Shift
  1. Click Align horizontally
Put the steps in one line and save · Click Align horizontally
  1. Click Fit to view
Put the steps in one line and save · Click Fit to view
  1. Click Save
Put the steps in one line and save · Click Save
Step 7 / 7

Run

At the bottom you see every pass with the item whose turn it was, and at the end how often the loop ran. After the loop, total is the amount of all lines together; the item line no longer exists then.

  1. Click Run
Run · Click Run
Run · Status: Completed.
Run · 3 passes done: one per line.
Run · total: 137.4 (86 + 26.4 + 25).

This guide was carried out step by step on 22 Oct 2026 by an automated test on Flow (version 3e563176).