Help

Re: Zapier loop for each record in view

2408 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Philip_Bassham
6 - Interface Innovator
6 - Interface Innovator

So, I am trying to write a snippet to use in the code step of Zapier.

Their documentation says

[output] An object or array of objects that will be the “return value” of this code. You can explicitly return early if you like.

Setting the output to an array of objects will run the subsequent steps multiple times — once for each object in the array. If Code by Zapier is the Zap’s trigger and an empty array is returned, nothing happens.

My problem is that this sure looks like an array of objects to me, but Zapier says its not. Any ideas?

24 AM

13 Replies 13

I have set most of my triggers as Slack messages, which I can trigger manually by sending a message to that channel, or set up from an Airtable notification on the event of an updated record in a particular view, for instance.

As far as the input data, in my code at least, it comes from the API fetch which brings in all data straight from a particular Airtable view.

So, the trigger can be anything, it doesn’t have to contain your trigger step. The input data is parsed from the API fetch call in your code.

For example, I have a “send messages with ManyChat” zap.

  1. In Airtable, I have 1 field that contains the message to send, and another checkbox field as a ‘send’ button.
  2. So, I have a Airtable view that is based on that ‘send button’ checkbox.
  3. And when that view is updated (I check a box), an “Airtable view updated” notification gets sent to a slack channel.
  4. My trigger for Zapier is a new message in that channel. And my code step gets all records in that view, sends the message via ManyChat, and uncheckes the “send” box, resetting the view.

Maybe that will help a little?

openside
10 - Mercury
10 - Mercury

Nishant - we (Openside) just released an ehanced zapier connector that can handle bulk items so can read in multiple rows at once to further process. This can likely help you do what you need.

Justin_K
4 - Data Explorer
4 - Data Explorer

varReminderList is currently 1,999 records for me, but Zapier will only let this run if it’s capped at 250 at a time. I would really appreciate it if someone could reply with how I limit the code action so that it only processes the first 250 records from the input. (Once a record is processed, it will be taken out of the loop, so the number will go down to zero once it’s run 8 times.)

THANKS IN ADVANCE! This code snippet has helped us so much over the last few years.

Hi @Justin_K - not sure if you saw my previous comment in this thread, but our On2Air: Actions product can handle bulk records and has ability to limit the amount processed to a specific number.