How can we access nested JSON object elements in a Zapier Webhook?
I tried with javascript and json.parser and that’s not work for me
How can we access nested JSON object elements in a Zapier Webhook?
I tried with javascript and json.parser and that’s not work for me
Best answer by SamBBest answer by SamB
Just wanted to jump in to summarize an answer here!
If the JSON coming from a webhook is valid, it should be possible to use JSON.parse in a Code by Zapier step to parse out the relevant fields as per PaulKortman’s post above.
If it’s not valid, you can try using Formatter (Text) actions to extract and split information out into separate fields but this would likely involve numerous additional steps and is less efficient than using a single code step.
To confirm whether the JSON is valid you can use a tool like JSONLint to validate it.
And for issues with parsing key value pairs specifically, TimS wrote an article in Community which explains how to do that:
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.