Skip to main content

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'}

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:


@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.


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!