Have large amounts of data in Google Sheets that you need to loop through but you’re not sure what is the best way import the data and then act on it? Then you’ve come to the right place! This post will show you how to use Zapier to loop through arrays imported from Google Sheets so that you can carry out actions in bulk for each of the array values as shown in the flow diagram below.
On a related note are you interested in learning more about APIs? APIs are the foundational building blocks that power modern software ecosystems like Zapier and the Demystify the API Crash Course will explain the fundamentals and give you a hands-on introduction to making your first API requests. Check out the course using the button below 🙂
In this post we’ll use the Customer Database Google Sheet to send delivery notifications to customers if their order is scheduled for delivery today. As explained in the Zapier Google Sheets Quick-Start Guide, there are a few different ways to import data from Google Sheets into Zapier as arrays depending on the number of rows or the amount of data you are importing.
For this example, we will use a webhook to send the arrays from Google Sheets to Zapier as explained in the Zapier Import Multiple Rows from Google Sheetspost. Then in our zap, we will use the “Catch Hook” trigger to receive the incoming webhook containing the array information.
Zapier Loop Through Array Workflow
Zapier Loop Through Array Action
Once the incoming array information has been received, it can then be used in the “Set up action” section of the “Create Loop from Text” action in the “Looping by Zapier” app. In the “Values To Loop” section, you can create a looping variable for each of your arrays and then specify the “Text Delimiter” so that Zapier can parse out all the array values to loop through.
N.B. One thing to bear in mind is that the maximum number of loop iterations that you can do using this loop through array action is 500. If you have more iterations to do than this then you will need to use nested looping (see the Zapier For Each Loop Quick-Start Guide).
After the “Values to Loop” have been setup, they can then be used in subsequent steps to supply a different value for that variable for each iteration of the loop.
Send Email for Each Array Value
Send SMS for Each Array Value
If you have not yet gotten yourself set up with Telnyx then take a look at the Marketo 2 Way SMS using Telnyx and Zapierpost to see how to get started with sending SMS.
One thing to note about sending SMS is that there are rate limits that apply to certain number types so if you try and exceed these limits, which is very likely when you loop through arrays, then the carrier will throttle the messages and spread them out over a longer timespan to ensure delivery. Therefore, do not expect all your SMS to be delivered right away when looping.
This throttling is implemented to prevent fraudsters and bad actors from easily being able to spam people with large amounts of SMS at once. If higher rate limits are needed you can get verified by your carrier who can then increase your rate limit or allow you to purchase another number type with higher throughput e.g. a short code number. If you want to learn more about rate limits and the pros and cons of the different number types then take a look at the Marketo SMS Marketing with Telnyxpost.
Post Loop Subsequent Actions
As shown in the flow diagram in the introduction, you can use a filter to stop looping so that actions after the filter will only run once. This is achieved by checking if the “Loop Iteration is Last” value from the loop through array action in Step 2 is TRUE.
Now that the Zap has progressed beyond the filter, a single summary email and SMS can be sent to a customer manager so that they can see all the customers who will receive deliveries today. Notice how the bodies of the email and SMS are using the array values from the webhook in Step 1 instead of the looping variables from Step 2. This is important because we want all the array values to be present in a single message, as shown in the SMS inbox image below.
What’s Next?
There you have it! That is how you can use Zapier to loop through arrays imported from Google Sheets so that you can carry out actions in bulk for each array value.
This example used the “Create Loop from Text” action from the “Looping by Zapier” app. There are 2 more actions available that you can use for looping: “Create Loop from Line Items” and “Create Loop from Numbers”. These actions are covered, respectively, in the posts below:
Greetings fellow MO 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.
Created with the assistance of DALL·E Introduction and Background In 2018, Edward Unthank introduced the four pillars of marketing operations, setting the stage for the management of effective marketing technology (Martech) functions. These pillars have since been the bedrock for many successful careers in marketing operations. My journey to redefine
Introduction When it comes to account-based marketing (ABM), your marketing team might have invested in intent data, built tailored content, and spent time targeting accounts. But is the juice worth the squeeze? You could say marketing operations teams are there in part to squeeze every last marketing dollar in order
Introduction: Blending Human and Technical Perspectives in Martech Caption: Future gardens of martech will blend human and AI perspectives As a co-host of the Humans of Martech podcast, I’ve had the privilege of interviewing some of the brightest minds in marketing technology. This unique experience has provided a blend of