Need help creating ZAPIER workflow to convert comma-separated values using Google Sheets lookup table

I’m working on a Zapier automation that gets triggered when someone submits a form through Zoho. One of the form fields contains multiple values separated by commas like this:

Example input: Product A, Product B, Product C, Product D

I need the automation to:

  1. Split the comma-separated text into individual pieces

    • Product A
    • Product B
    • Product C
    • Product D
  2. Look up each piece in a Google Sheets document that has two columns:

    • Column A: the product name to search for
    • Column B: the matching code number

Sheet structure:

Product A    | 101
Product B    | 205
Product C    | 187
  1. Get the code from Column B for each match, or use 999999 if no match is found

  2. Combine all the results back into one comma-separated string like: 101, 205, 187, 999999

I know I can use Zapier’s text splitting feature for the first step, but I’m stuck on how to loop through each item and do the Google Sheets lookup. Support mentioned I might need custom JavaScript code.

Has anyone solved something similar? Any suggestions would be really helpful!

I hit this same issue with product catalogs last year. JavaScript works, but there’s an easier way - use Zapier’s Looping action with Google Sheets lookups. After your text formatter splits the comma-separated values, add a Loop by Zapier step. Inside the loop, drop in a Google Sheets lookup for each item. The tricky bit is those ‘not found’ cases - throw in a Path action to catch empty lookups and swap in 999999. Once the loop’s done, use another Formatter to stick all the codes back together with commas. No custom code needed and way easier to debug when stuff breaks.

I’ve hit this exact problem building inventory workflows. Zapier’s native approach works for small datasets, but you’ll slam into performance walls and action limits fast with large lookup tables. Google Sheets’ VLOOKUP saved my ass here. Make a helper sheet in your Google Sheets doc and dump that whole comma-separated string into one cell. Then use ARRAYFORMULA with SPLIT and IFERROR to handle everything at once. Have Zapier grab just the final result cell. This drops your action count from dozens down to 2-3 total, and IFERROR handles that 999999 fallback automatically.

for sure! using js loops is the way to go in zapier. i had similar struggles, but once i got my code down, it all came together nicely. just keep pushing through and you’ll get it!

zapier’s code step is your best bet! split the string n then loop through each item with a sheets api call, then just join the results back up. it’s maybe 20 lines of js, way cheaper than all those looping actions.

This is exactly why I ditched Zapier for complex data stuff. You’re looking at multiple loops, custom JavaScript, and you’ll hit those action limits fast.

I built something similar last month - a product mapping system. Latenode handles this way better than Zapier. You can process the whole comma-separated string in one workflow instead of breaking it into a million Zapier actions.

With Latenode: grab your Zoho data, split the string, batch lookup everything against Google Sheets in one shot, return the result. No JavaScript needed, and you dodge Zapier’s per-action pricing.

It handles your 999999 fallback automatically. Process hundreds of products without timeout headaches or action limits. Debugging’s easier too - everything’s in one clean flow instead of scattered across tons of Zapier steps.

For data transformation like this, purpose-built tools just make more sense than forcing Zapier into stuff it wasn’t designed for.