Search code examples
formattinglookup-tableszapier

Is there a way to copy Zapier formatter lookup tables from one zap to another?


I need to add a lookup table that converts states to abbreviations to 5 zaps that are already configured. Right now, the only solution I see is to recreate the lookup table for each zap, which is very time consuming.

Does anyone have suggestions how to do this programmatically, maybe using the Javascript/code action?


Solution

  • David here, from the Zapier Platform team.

    That's sort of possible! Unfortunately you can't copy them as the lookup table step, but the code they're mimicking is very straightforward.

    In javascript:

    const mapping = {
      // input : output
      TX: 'Texas',
      CO: 'Colorado',
      CA: 'California'
    }
    
    return {
      output: mapping[inputData.input] || 'fallback value'
    }
    

    You'll need an input field called input and you create your own mapping. That's basically all the lookup table is! It can be copy-pasted across zaps pretty easily. So, replace all your lookup table steps with Code steps and you're off to the races!