Skip to main content
Question

javascript json.parse gives single quotes

  • May 22, 2025
  • 3 replies
  • 42 views

I am trying to construct json for an api call but using javascript, but when I try the following I am getting single quotes which is failing. How do I get double quotes from json.parse

 

const obj1 = JSON.stringify(myObj);

{"shipment":{"service_code":"fedex_priority_overnight"}

 

const obj = JSON.parse(obj1)

shipment: { service_code: 'fedex_priority_overnight'}

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

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34032 replies
  • May 22, 2025

Hi ​@GDHANRAJ 

For us to have full context, post screenshots showing how your Zap step is configured in EDIT mode with the field mappings visible.

 

TIPS:


Mohammad_Shahzaib_Nawaz
Forum|alt.badge.img+3

@GDHANRAJ 

JSON.parse is used to convert existing JSON in a javascript object, If you want to send JSON then you should use JSON.stringify, this will convert the javascript object into JSON form.


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 9676 replies
  • June 20, 2025

Hey ​@GDHANRAJ, just checking in—did Mohammad_Shahzaib_Nawaz’s suggestion help to get this sorted? Or did you figure out a different solution?

If you did solve it, we’d love it if you could share what the solution was. This would be really helpful for others that are running into similar issues. 🙏

And if you’re still stuck at all, feel free to share some screenshots of your current setup as Troy mentioned and we’ll be happy to take a closer look!