Help

Processing an Array of Records via Zapier

2412 4
cancel
Showing results for 
Search instead for 
Did you mean: 
Adam_Lockwood
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi y’all,

I’m trying to use Zapier to perform an action on a comma separated string of records, where that string is variable in length. It could be four records long, it could contain no records. As you probably know, Zapier natively will not iteratively work through a list of records and perform the Zap’s step to each. Having the ability to perform the following steps on a list of records would be fantastic.

Alternatively, if I could break that string of records out into individual items, I could set up a complex series of filters and repeating steps, but I’m having trouble with that as well. In the past, I’ve used Zapier’s Text module to separate text into separate fields using [:space:] or [:return:]. However, when I try to use comma as a separator, I only get the string of records back as the output, not the individual records.

Go easy on me. I’m not much of a coder, and still a bit of an Airtable n00b. :slightly_smiling_face:

4 Replies 4

You can do this with a code-step and a for loop.

CleanShot 2020-06-14 at 10.22.52

Where inputData.lines would be as follows:

var lines = inputData.lines.split(',') 

Then run a for loop for the length of lines:

 for (var i = 0; i < lines.length; i++) {
***CODE COES HERE******

}

Brian_Don
4 - Data Explorer
4 - Data Explorer

Hey Adam,

You can try doing that with a Zapier alternative called Automateio.

I suggest you use its Formatter app to break that string of records with the ‘Split text’ operation in the app and use the comma separator. Then use the appropriate filter if necessary.

Brian :slightly_smiling_face:

Thank you @andywingrave! I’ll play around with that. I figured out a solution, but it seems a little inelegant, so I’m going to keep tinkering.

@Brian_Don, thank you for the recommendation. I actually figured out what I was doing wrong in Zapier:

Since my records were coming in as a string (e.g. [recXXXXXXXXXX, reXXXXXXXXXX, recXXXXXXXXXX]), I had to first convert them to text to split them out appropriately. That made each one individually usable in subsequent steps.

Then I used a series of filters–to stop unneeded operations–and repeated steps to affect each record appropriately. It seems a little bit clunky, but it got the job done.