Question

Why does zapier keep concatenating array elements into one string? How do I prevent this?

  • 8 May 2024
  • 1 reply
  • 8 views


I spent countless hours creating a JS function that organizes my data into array elements — clean slices of data that can be selected and inserted into my subsequent Zap steps.

Now that I’m happy with the my data format, I go to select this data and it’s once again concatenated into one giant, useless string!


WHY does Zapier keep doing this? What is the usecase of automatically joining array elements and concatenating them into a string at every whim?? And how I do I stop this from happening?


1 reply

Userlevel 7
Badge +14

Hi @Jmart 

The data in the variable is still an array, it just displays as a concatenated list, which looks like a string.

 

For us to have more context post screenshots with how you are trying to use the Code step data into the following Zap action step(s) so we can see the field types and field descriptions, plus elaborate about the purpose of the Zap you are trying to configure.

 

If you need to iterate the array, you can use the Looping app: https://zapier.com/apps/looping/help

 

If you are trying to map the variable that is an array, then the field must support line items.

 

Help article about using Line Items in Zaps: https://help.zapier.com/hc/en-us/articles/8496277737997-Use-line-items-in-Zaps#1-identify-your-trigger-s-line-item-fields-0-0

Reply