Skip to main content

Just starting out and struggling with basic data access.  I have a formatter step that creates what you see below.  I tried every possible idea I could think of related to “pill mapping” to map each of the 3 lines out to different variables in the next step.  Seriously, why is this so hard.  Any ideas on how to solve this?  

 

Hi ​@WhoTookMyName 

The data output shown in the screenshot is structured as an array.

When you go to map a variable that has an array value, it will look like a comma separated listed.

 

OPTIONS

  • Formatter > Utilities > Pick From List
    • Pass in the array variable, then specify which array item you want output
  • Formatter > Utilities > Line Items to Text
    • Flatten the array into a string
      • Then use Formatter > Text > Split
        • Specify the output format as separate variables
      • Alternatively use a Code step to output variables with values
        • Probably want to delimit the array values with a | to make splitting in the code logic cleaner
  • AI by Zapier
    • Prompt AI to output specific values that you designate as a variable

I think you are suggesting I add some additional steps to pick out the individual variables.  Which I suppose I could do.  I wanted to take the array and pick out each variable (text) and map each into 3 separate fields in the next step (Notion database insert) 


@WhoTookMyName 

Yep, try the suggested options.

 

Easiest is to add this Zap step 3 times...

  • Formatter > Utilities > Pick From List
    • Pass in the array variable, then specify which array item you want output

Hey!

Have you tried using the Segment Index: All (as separate fields) option in the Split Text Formatter step?


Hi ​@WhoTookMyName 

Laura here from Zapier Support happy to chime in.

Working with arrays can be tricky at first, but there's actually a straightforward solution as already mentioned by ​@Troy Tessalone 

The line item to text formatter should do the trick based on the format of the data you are looking to split out - https://help.zapier.com/hc/en-us/articles/8496308258189-Convert-line-items-into-text-strings

I hope that clarifies things, please let me know if I can help further.

Laura


Hey!

Have you tried using the Segment Index: All (as separate fields) option in the Split Text Formatter step?

Yes, that’s how I got to the step you see above.  My question is about the next step.  I will try Troy’s approach


@WhoTookMyName 

Yep, try the suggested options.

 

Easiest is to add this Zap step 3 times...

  • Formatter > Utilities > Pick From List
    • Pass in the array variable, then specify which array item you want output

I had high hopes for this one, but it did not work.  You can only pick first, last or random using this formatter.

After that I tried some other transform methods - none of them worked.

I ended up getting this work using an “AI by Zapier”.  I did not like taking this approach as since I have ‘deterministic’ data from the previous step and then I’m using a non-deterministic method to then insert that into a database.  

 

I’ll see how it goes, but in my opinion, if this is the only way to do this in Zapier - it's not going to be a tool that I would recommend to others.


@WhoTookMyName 

Formatter > Utilities > Pick From List

You can specify any number using the “Custom” mode option as indicated by the warning above the field.

0 for the first item

1 for the second item

2 for the third item

and so on