Zapier Looping Quick-Start Guide

Explore all the ways to setup a Zapier for each loop using the 3 native “Looping by Zapier” actions or your own custom definitions within “Code by Zapier” actions in Python or Javascript and how you can overcome Zapier’s 500 iteration or 10 second timeout limits using nested loops.

Since all the examples linked to within this post either retrieve data from or manipulate data in Google Sheets, the Zapier Google Sheets Quick-Start Guide will show you the ropes you need to take the reins!

“Looping by Zapier” For Each Loop

The three Zapier for each loop actions available in the "Looping by Zapier" app
The three actions available in the “Looping by Zapier” app

The inbuilt “Looping by Zapier” app has three actions that enable you to do up to 500 iterations of all the actions contained within the loop. Unfortunately, Zapier say that the only way to get more than 500 iterations is to contact their support team to get your name added to the feature request so that you will be notified when their engineers release this feature.

Can’t wait that long?

Take a look at the “Code by Zapier” For Each Loop and Nested Zapier For Each Loop sections below to see how you can iterate like its 2008!

“Create Loop From Line Items”

Flow diagram of Zapier for each loop line item iteration
Flow diagram of Zapier for each loop line item iteration

When importing data from Google Sheets using the “Find Many Spreadsheet Rows (With Line Item Support)” action the data is returned in line item format where you get an array for each column in your sheet. The Zapier Loop Through Line Items Example post will show you how to use the “Create Loop from Line Items” action to loop through the row values contained within these arrays.

“Create Loop From Text”

If the values you want to loop through are contained within text variables then you can use the “Create Loop from Text” action, as is done in the Zapier Loop Through Array from Google Sheets post, to split your text variables into arrays of values that you can then iterate through to do things like sending a personalized SMS to each person in a Google Sheet.

Example of using a Zapier for each loop to send personalized SMS to customers
Example of using a Zapier for each loop to send personalized SMS to customers

“Create Loop From Numbers”

The third and final “Looping by Zapier” action allows you to use a number range to control the iterations of your Zapier for each loop. The Zapier Loop Action post walks you through how to use the “Create Loop From Numbers” action to update rows in a Google Sheet corresponding to the numbers within your custom defined number range.

Zapier for each number in range loop overview
Zapier for each number in range loop overview

“Code by Zapier” For Each Loop

While the three “Looping by Zapier” actions are easy to configure they do have the limitation that you can only do 500 iterations at once. To circumvent this restriction you can build your Zapier for each loop into Python or Javascript code within a “Code by Zapier” action (as shown in the Zapier Nested Looping using Webhooks & Python post) with the added benefit that you now have the ability to completely customize what your loop does.

Beware though that each Zapier action has a 10 second timeout limit so if your Zapier for each loop code tries to do too many iterations at once and runs for more than 10 seconds then this “Code by Zapier” step will fail.

This is where nested loops in Zapier come in useful because you can put these “Code by Zapier” loops or “Looping by Zapier” actions within an outer loop so you can continue to iterate until all your jobs are complete.

Nested Zapier For Each Loop

Nested loops in Zapier are powerful because they allow you to overcome the 500 iteration limit of the “Looping by Zapier” action or the 10 second timeout limit imposed when looping within “Code by Zapier” actions.

The nested Zapier for each loop is contained within an outer loop formed by a “Catch Webhook” trigger event at the start and a “Send Webhook” action at the end, which passes along the necessary information for the next iteration of the outer loop to continue from where the current iteration finished off.

The Zapier Nested Looping using Webhooks & Python post shows you how to nest a Python loop.

Nesting a Python for each loop in Zapier
Nesting a Python loop in Zapier

The Zapier Loop Array with Nesting posts shows you how to nest a “Looping by Zapier” action.

Nesting a "Looping by Zapier" action in Zapier
Nesting a “Looping by Zapier” action in Zapier

Zapier For Each Loop Follow Ups

Now that you know how to create a Zapier for each loop, you are ready to add more tools to your Zapier Swiss army knife! Take a look at the posts below to learn about other Zapier features and see how they can be applied in real-world examples.

About The Author — Tyron Pretorius
Tyron Pretorius

Greetings fellow MOPs pros! As a previous mechanical engineer turned marketing operations lead, I now fancy myself as a full-stack marketer capable of designing websites, writing SEO-optimized content, and doing all the tracking and automation on the backend. That being said my bread and butter is marketing operations and I love to get down and dirty with the Marketo API, Python, Zapier, and Google Scripts.

Related free workshops

Google Sheets data being accessed in a Zap action in Zapier

How to use Zapier with Google Sheets

Integrating Google Sheets with Zapier will allow you to unlock a whole new array of automation possibilities for the data in your spreadsheets. This post will show you how to use Zapier with Google Sheets by walking through the 3 different options for importing data into Zapier using the Google Sheets app.

Become a member
Timestamp being used as the Google Sheets lookup value in Zapier

Zapier Google Sheets Lookup Value

When trying to pull a specific row from your Google Sheet into Zapier you can use a lookup value dynamically populated with a variable from a previous step. This is useful but the real power of using the Google Sheets lookup value in Zapier comes when you need to import large amounts of data into your zap.

Become a member
Button in Google Sheets to trigger a Google Script to send multiple rows to Zapier

Zapier Import Multiple Rows from Google Sheets

Anyone who has worked with Google Sheets in Zapier is likely to have run into the issue of needing to import more than the 20-row maximum imposed when using the Google Sheets app. This post will show you how to overcome this limitation and import multiple rows from Google Sheets into Zapier using some JavaScript and webhooks.

Become a member