What method can be used to iterate through a lot of variables in a zap to search and replace all instances of a specific string with another string. My specific need is to replace all instances of ‘N/A’ with an empty string (‘’) in 40+ variables. I know this can be done on individual variables using formatter, but this method is neither practical or scalable. This also eats up a lot of steps in your plan.
Ideally the result would be that the content of the variables themselves are altered as mapping them to additional variables that contain the result would be a hot mess. For example If I had a variable ‘Foo’ with a value of ‘N/A’ and a variable Foo2 with a value of ‘N/A’, I would want the result to be that Foo has a value of ‘’ and Foo2 has a value of ‘’ (Rinse and repeat for 40+ other variables).
I’ll need to access the individual values of each of the 40+ variables after the string replacement.
You can add a code step in which you can pass in the variable as input, clean/replace them and output all the 40 variables which you can use individually in the zap later.
Hi
FYI: Formatter steps count as 0 Tasks in Zap Runs.
NOTE: If you are able to get access to the RAW JSON for the Zap step, then you can use 1 Formatter step to do the replace.
Otherwise, using a Code (JavaScript/Python) step in the Zap is the most efficient way: https://zapier.com/apps/code/integrations#help
Thanks for the suggestion
I’ll need to pass each of the 40+ variables to the code task, perform the string replacement, put the results within each of the the original variables, and then access the result of all 40.
Explored the use JavaScript in the code task to tackle this but lost my way as I’m not versed in JavaScript. Tried to leverage AI to build the JavaScript but unfortunately couldn’t work it out.
If you are looking to hire help, there is a directory of Zapier Partners: https://zapier.com/partnerdirectory
Thanks for the intel that formatter doesn’t count as a task @Troy Tessalone!
I like the idea to bundle it all together (IE.. raw JSON concept) to facilitate a single formatter step with find/replace. Unfortunately the content is not accessible as a single JSON entity.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.