07-02-2018 11:07 AM - edited 03-14-2019 06:18 PM
I am using a REST call to get a JSON reply back from our CRMs API - this all works and I get the reply placed in a string variable.
When I watch a reactive debug, the string variable with the JSON response is using escape charaters for the double quotes as below which I would expect is normal for a string:
sResponse String U"[ { \"id\": 70333 }]"
I then am using a Create JSON Document step to put the string into a JSON doc for parsing but while watching in the reactive debug, the DOC value following this step still contains the escape characters and the subsequent Get JSON Document Data step to parse it fails:
dJSONOutput Document TEXT[[ { \"id\": 70333 }]]
JSON path I am using is $.*.id which I have validated using JSONpath
Full script attached:
Am I missing something to get the JSON properly in the document? Any help would be much appreciated!
Thanks,
Greg
Solved! Go to Solution.
07-04-2018 04:19 AM
Your JSON data needs to have the data be in double quotes as well as the id
The back slash is the normal Java escape character for the double queue and does not cause a problem
This little script works OK and extracts the 70333
Graham
07-03-2018 07:00 PM
Ended up scrapping the built-in 11.6 JSON steps and just using custom Java classes to parse out the JSON.
07-04-2018 04:19 AM
07-04-2018 07:52 AM
Thanks Graham!
Tried that out and it works as well.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide