Loop
A Loop repeats the same steps once for every row of a table. Start from a list of sales reps, and a loop can build each rep a workbook of their own pipeline and, with a Deliver step inside, email it to them.
Who can see this: anyone who can open the project. To add or change a loop, or use Send all reports, you need to be able to edit the project.
- The loop’s steps: a small Data Flow of what runs for each row.
- Send all reports: run every row and send the emails.
- Open in canvas: go to the loop in the Data Flow.
- Previewed 5 of 40 · not sent: what the last run did.
When to use it
Section titled “When to use it”Would you otherwise make the same request once per item? That’s a loop: a workbook per region, a chart per store, an order summary for each customer. One row of the table is one run of the steps.
If everyone gets the same report, you don’t need a loop. One Deliver step can email the same file to a whole list of people.
Ask for it
Section titled “Ask for it”Ask in project chat, and start with “for each”. Say what to repeat over, what to make for each one and, if it should be emailed, where the addresses are. For example:
For each sales rep, build an Excel workbook of their open pipeline and email it to them. The email column has their address.
Querri builds one Loop step on the table of reps, with the steps to repeat below it. Here that might be a step that pulls the rep’s deals, an Excel Export and a Deliver step. Each step inside the loop works on the current row, and the Deliver step’s recipient is a variable, {{email}}, so each email goes to that row’s address.
Loop over a table with one row per item. If a rep appears on 30 rows of deals, the loop runs 30 times for them.
You can also add a loop yourself. In the Data Flow, click + under the table and pick Loop. Any step you then add below the loop runs once per row.
What happens
Section titled “What happens”A preview first
Section titled “A preview first”When Querri builds a loop with an email or export step in it, it doesn’t do every row. It runs the first 5 as a sample, sends nothing, and says so in the loop’s message: “preview only (5 of 40; enable delivery to send all)”. Open a few rows and check them.
A loop without an email or export step runs every row straight away.
Sending every row
Section titled “Sending every row”Send all reports opens a dialog saying the loop will run again and send 40 emails, one per row, with the recipients as they’re written, like {{email}}. Click Send all. Run Now with Deliver Messages ticked does the same, and so do the project’s schedule and Test Now in its schedule dialog.
While it runs, you’ll see “Processing row 12 of 40…”. A row that fails doesn’t stop the others, and it’s counted as failed. Cancel on the toolbar stops before the next row, and the message ends “cancelled after 12/40 rows”.
The loop in chat
Section titled “The loop in chat”In project chat, a loop gets one card, with its name, a small Data Flow of the steps inside it, and a line about the last run:
- Not run yet
- how many rows ran, with ✓ for finished and ✗ for failed
- ✓ 40 sent, or Previewed 5 of 40 · not sent with Send all to deliver the rest
- ⚠ structure changed · re-run, when steps were added inside the loop after it last ran
The steps inside a loop don’t get cards of their own. Open in canvas opens the full Data Flow at the loop.
In the Data Flow
Section titled “In the Data Flow”- Loop: the loop’s step.
- The dashed box: the steps that run for each row.
- ◀ 3/5 · WEST ▶: which row of the last run you’re looking at.
Click ◀ and ▶ to move between rows. A row’s label comes from the loop’s Key column, and without one, rows are numbered.
Changing the loop
Section titled “Changing the loop”Expand on the loop step opens Loop configuration:
- Driver step: the table it loops over, with its row count.
- Key column: the column that labels each row, like the rep’s name. Leave it empty to number the rows.
- Max iterations: the most rows a run does. Blank means 1,000.
- Body steps: the steps that run once per row.
Click Save. To change what happens for each row, change the steps inside the loop, or ask in project chat. There’s no refine box on a loop.
Limits
Section titled “Limits”- A run does up to 1,000 rows unless Max iterations says otherwise. Rows past the limit are skipped, and the message says how many.
- A preview does 5 rows.
- Every email follows the Deliver limits: 10 MB per attachment, 25 MB per email.
Credits
Section titled “Credits”Asking for a loop in project chat uses a credit for the question, as usual. Running it yourself, with Send all reports or Run Now, doesn’t use credits. A scheduled run costs one credit per 10 steps that ran, at least one, and the loop counts as one step however many rows it has. Your plan may differ; see How credits are counted on Monitor usage.
- Set a Key column, like a name, so you can tell rows apart in chat and in the Data Flow.
- Check the preview before you click Send all reports. Look at a couple of rows and at the Deliver step’s recipients.
- To test a real send, set Max iterations to 1 and the Deliver step’s recipient to your own address. Put both back afterwards.
- A scheduled loop sends every row’s email on every run, so make sure the table it loops over is the list you mean.