Skip to main content

I have a Zap that runs a loop to pull an employee # from a csv file, call an API to get a value from the employee’s profile, and then I need to do a find/replace in the csv file to replace the employee old value with the new value. I can’t seem to be able to find a working solution that will pull in the csv file, then continue to update it until all records are updated. I keep getting stuck with the loop going back to replace the original csv file. In general, this is what my zap looks like where I’ve tried using Tables and Files. Any ideas?

 

Hi ​@melissa.hunchuck 

Your screenshot shows a Zap app action that do not exist:

  • Files by Zapier - Get File
  • Files by Zapier - Update File

These are the available File by Zapier triggers/actions: https://zapier.com/apps/files-by-zapier/integrations#triggers-and-actions

 

For the general Zap logic, you likely have to upload the CSV file to GDrive via the GDrive Zap app, then you can use the GSheets Zap app to do the updating of rows in the GSheet.

 

https://zapier.com/apps/google-drive/integrations#triggers-and-actions

https://zapier.com/apps/google-sheets/integrations#triggers-and-actions

 

 


@melissa.hunchuck 

If you are looking to hire help, there is a directory of Zapier Partners: https://zapier.com/partnerdirectory


Hey ​@melissa.hunchuck,

It’s a bit hard to tell the exact issue you are running into from the screenshot and what you described. But some of troubleshooting you can try-

  • Do not edit CSV directly but just rather use Zapier Tables/ Sheets and in the end create a CSV.
  • If you have any problems with editing the Same CSV, try creating multiple CSVs for different versions to see if it solves your problem. 
  • Also you can’t use a loop inside a Sub Zap if you see the limitations here- https://help.zapier.com/hc/en-us/articles/8496106701453-Loop-your-Zap-actions

I think try these to see if it fixes your issue. Hope it helps!

PS: If you need more active help, I’m happy to connect through my Zapier Solution Partner page if you’d like to reach out here- https://zapier.com/partnerdirectory/automation-jinn


Incase anyone else stumbles upon this looking for the same solution in the future, I have a working Zap solution that does what I need it to do but I will continue to refactor it to move off of google sheets if possible. Also note, looping and sub-zaps does work so long as you use the method mentioned below with the filter step. 

The summary of my workflow is:

  1. Main zap - grabs my csv file from an API call
  2. Sub-zap: transforms the csv file to a google sheet
  3. Data is looped in the sub-zap so that we grab 1 employee # and look it up via API for the employee’s payroll #
  4. Find the matching employee # + company code and then replace the existing employee’s payroll # from the source file in the google sheet
  5. At the end of the looping, filter for last iteration = true and wait 1 minute so the google sheet catches up with updates
  6. Rebuild the csv file and send back to main zap
  7. Main zap then builds the json to send to the payroll system

 


Awesome work here ​@melissa.hunchuck! 🙌 Thank you so much for sharing details on how you solved this - it’s super helpful for others who might be building similar workflows. And thank you ​@Troy Tessalone and ​@Sparsh from Automation Jinn for jumping in to help out 🧡

Hope you all have a great rest of your week!