Skip to main content
Best answer

Text to Line Item not importing into a JSON array correctly

  • February 8, 2021
  • 3 replies
  • 527 views

nickgurney

Hello Zapier Community!

I am having a little trouble with adding to a JSON array using line items. In my Zap, I get an array object from a webhook to Clubhouse (https://clubhouse.io/api/rest/v3/#Update-Story). This array can have any number of items in it, and they are all URLs. 

My goal is to add to this array. In order to do this, I am converting the line items to text, appending the new URL from my trigger, and then attempting to pass that array to a webhook to Clubhouse

The problem is when I attempt to pass that array though the webhook back to the API, I get a “The app returned "Malformed JSON in request body.".” error. When looking at the data, I see that the URLs are all missing the quotations they should be surrounded in. 

Any ideas on how I can surround the URLs with quotations? Or get the Text to Line Item to include the quotations?

Thanks so. much for your help!

Best answer by GetUWired

Have you tried just using the utilities > line items > line itemizer to append more urls. If you are truly putting an array into the field I wouldn’t think you would need to specify that each element in the array is wrapped in quotes. 

If it is a text field. You can replace the commas with commas surrounded by quotes by using a text formatter action, searching for a comma, and then replacing it with “,”. Then you would just need to tack on “ before and after the text field and voila! 

 

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

GetUWired
Forum|alt.badge.img+12
  • Zapier Expert
  • 1030 replies
  • Answer
  • February 8, 2021

Have you tried just using the utilities > line items > line itemizer to append more urls. If you are truly putting an array into the field I wouldn’t think you would need to specify that each element in the array is wrapped in quotes. 

If it is a text field. You can replace the commas with commas surrounded by quotes by using a text formatter action, searching for a comma, and then replacing it with “,”. Then you would just need to tack on “ before and after the text field and voila! 

 


nickgurney
  • Author
  • Beginner
  • 3 replies
  • February 9, 2021

@GetUWired it worked! I bet I could mess with it more and get the line items to work, but for some reason was having trouble. The text solution worked though! Thanks! 


GetUWired
Forum|alt.badge.img+12
  • Zapier Expert
  • 1030 replies
  • February 9, 2021

@nickgurney 

Always happy to help!