Skip to content
Tutorials Center
My learning

Topics

Lesson 18 of 36 ยท Filters, Paths and Formatting

Looping, Lookup Tables, Delays and Digests

Handle lists and timing in Zaps: loop over line items, use lookup tables for mappings, delay steps, digests that batch events, and runnable stand-ins for each pattern.

The previous lessons handled single records and simple conditions. This one covers four tools for trickier shapes: looping over lists, lookup tables that map values, delays that pause a run, and digests that batch many events into one message. Together they let you build automations that behave sensibly with lists and with time.

Zapier cannot run on this site. Tool names and plan availability can change, so check the current documentation. The Python blocks are labelled stand-ins that model the behavior.

Looping

An order has three line items, but your target app expects one record per item. Looping (Looping by Zapier) takes a list of values and runs the steps that follow once per item. You provide the values (line items from an earlier step, or typed lists) and Zapier iterates. After the loop, you can collect the outputs back into a list.

flowchart TD
  T["Trigger: order with 3 items"] --> L["Loop over items"]
  L --> A["Create task for item"]
  A --> N{"More items?"}
  N -->|"yes"| L
  N -->|"no"| D["Send one summary"]

Each loop iteration may consume tasks, so a 50-item order costs about 50 times the action steps inside the loop.

Things to know about loops:

  • Iterations can be limited in number; check current limits.
  • Each action inside the loop normally counts as a task per iteration.
  • If one iteration fails, the loop may stop; plan for partial results.
  • Alternatively, many apps accept line items directly in one action, which is cheaper than a loop.

A loop: a stand-in

Python Stand-in: loop with partial failure

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Decide whether partial success is acceptable. For money or inventory, usually it is not, so validate every item before the first create.

Lookup tables

Many decisions are mappings: country to sales rep, product code to price list, status number to label. A lookup table (a Formatter utility, or a Zapier Table when it is large or shared) maps an input to an output. It beats a long Paths chain: the mapping is data you can edit, not logic spread over branches.

Python Stand-in: lookup table with a default

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Always provide a default so unexpected inputs do not produce empty values, and normalize the key (trim, upper-case) before the lookup.

Delay

A Delay step pauses the run: for a fixed time ("1 hour"), until a date-time, or until a particular day and time. Typical uses:

  • Wait before sending a follow-up email.
  • Wait for another system to finish (a "cooling off" period).
  • Respect business hours by delaying until 9:00 tomorrow.

Delayed runs are not "lost": they wait and then resume. During the wait the data is the original event data, which may be stale when the Zap resumes. Re-check current values with a search after the delay, for example "is the invoice still unpaid?" before sending a reminder.

Python Stand-in: delayed reminder that re-checks state

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Digest

A Digest (Digest by Zapier) collects entries over time and releases them together: a daily summary, a weekly list, or one message after ten entries. You append entries as events arrive, and on a schedule (or when released) a final step sends the combined text. It turns 50 noisy messages into one useful one.

Typical design:

  1. Zap 1: on each new event, append a line to a digest.
  2. Zap 2: every weekday at 17:00, release the digest and send it.

An alternative, when a database or table is available, is to store events in a table and query it on a schedule. Digest items live for a limited time, so do not treat them as permanent storage.

Python Stand-in: collect events, release a digest

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Choosing the right tool

Problem Tool
One record per list item Looping, or an app action that accepts line items
Map value A to value B Lookup table
Wait, then continue Delay (re-check data after waking)
One message from many events Digest, or a table plus a scheduled Zap
Branch on conditions Paths (paths)

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does a loop do?

    Looping iterates over values, so steps inside run per item.
  2. 2. Why provide a default in a lookup table?

    A default handles inputs the table does not contain.
  3. 3. After a delay, the Zap resumes with:

    Re-check current state with a search before acting on old data.
  4. 4. Which tool turns many events into one message?

    Digests collect entries and release them together.

Summary

  • Loops run steps once per list item; mind task cost, limits and partial failures.
  • Lookup tables map inputs to outputs with defaults, replacing sprawling branches.
  • Delays pause runs; re-check current data when they resume.
  • Digests batch events into a single summary.

Next: Webhooks by Zapier: Catch Hook