Question

json array object that has no key gets combined comma separated value single value

  • 28 August 2020
  • 4 replies
  • 979 views

Userlevel 1

Hi,

Currently i see one issue with zapier. it converts json array object which has no key inside to comma separated values without quotes and combine them as string.

for example

{
  "images": [
    "xxxx.jpg",
    "yyyyy.jpg",
    "zzz.jpg"
  ]

}

this one becomes   "images": "xxxx.jpg,yyyyy.jpg,zzz.jpg"

 

Is there a way to retain the same structure when forwarded to next step?


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

Userlevel 7
Badge +10

Hi @rpfw34 

Just checking in. Did you manage to get this resolved?

Userlevel 1

Hi, Thanks for the response.

In my my first step(When this happens), I am receiving the JSON using web hook (catch hook) as I mentioned my json has arrays of string

{
  "images": [
    "xxxx.jpg",
    "yyyyy.jpg",
    "zzz.jpg"
  ]}

In the second step (do this), the action, I am trying to POST the same message (forward without modifying) using webhook by zapier.

But the message that gets forwarded is not an array of sting but a single string which comma separated concatenated string of the array.

"images": "xxxx.jpg,yyyyy.jpg,zzz.jpg".

If you observe it is a single string within double quotes.

I have use case where I just need to maintain the structure.

Thanks.

Userlevel 7
Badge +12

@rpfw34 - In general and as far as I understand it, unless the next step input field supports line items, array values from one step will be passed as a comma-separated string to the subsequent steps.

Userlevel 7
Badge +9

Hey! Can I understand the use case a little more. 

  1. Where are you getting the JSON from?
  2. What is the next step?
  3. Why is it important to retain the structure in this particular case?