Forum Discussion
j_angelevski
4 years agoContributor III
Hi @pcoleman,
The following expression
JSON.parse(jsonPath($, "entity.feed.entry[*].content['$']"))
should be enough to parse the JSON string, you don’t need to replace the \n
characters.
- pcoleman4 years agoNew Contributor III
Unfortunately, it gives me the following when I try that. It seems to somehow interpret it as a list.
“error”:
“Expecting a string argument”- j_angelevski4 years agoContributor III
Most likely the JSON.parse() method recieved an array instead of string.
If your content it’s always on the same index in your entry array, you can use the following expressionJSON.parse($entity.feed.entry[2].content['$'])
or
JSON.parse(jsonPath($, "entity.feed.entry[*].content['$']").toString())
- pcoleman4 years agoNew Contributor III
This worked, though I needed to preface this with a JSON Splitter. Clearly I overcomplicated this. Thank you!