Forum Discussion
bojanvelevski
4 years agoValued Contributor
Hey @MikeP ,
Somewhere in the process the JSON is improperly stringified. Proper way of doing this (in snaplogic) would be:
JSON.stringify($jsonObject)
Here’s an expression that I believe would help in most of the cases:
JSON.parse($jsonObject.replaceAll('{','{"').replaceAll('}','"}').replaceAll('=','":"'))
I’m saying in most of the cases because keys or values can contain some of the characters I’m replacing in the expression. The purpose of replacing is to be able to parse the JSON again, and if some of the characters are present in key/value, than those will be replaced with the character set accordingly and the JSON will be kind of transformed.