Skip to main content

I have a Zap where I import a CSV and then later down the line I want to filter out some rows depending on the values within that row.


Example CSV:

id,name,color

1,john,red

2,mary,blue

3,sam,red


In this CSV, I only want to proceed with people who are tagged as red. I tried to accomplish this using the "Run JavaScript" app, but even though I return an array of data, it seems to only return 1 row. Does anyone know how to do this? Thanks.


When a Code step returns an array of data, it's interpreted as multiple instances of single rows of data -- your subsequent steps in the Zap will trigger on each row individually, and in the preview, you're only seeing the first row. It can be very useful, but probably not what you want in this case.

You should be able to have your code step return a single object containing an array, like

return {data: your_filtered_csv_data};



I think this did the trick! I am working on some other issues with my Zap, but this part seems to be fixed! Thanks!