01-02-2020 03:07 AM
I have a input as given below, how to convert into Json object.
“actions_values_json”: ““RecordID”: “22”, “FullName”: “Monique Davis”, “AddressLine1”: “12 N Manning Blvd””
output should be
{
“RecordID”: “22”,
“FullName”: “Monique Davis”,
“AddressLine1”: “12 N Manning Blvd”
}
01-02-2020 06:03 AM
The JSON parse() and stringify() functions might help.
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439335/JSON+Functions+and+Properties
Try a mapper snap that does a JSON.parse($actions_values_json)
01-02-2020 07:06 AM
Thank you Christwr
01-02-2020 06:55 AM
Since the value is a plain string you need to add some extra characters for the parsing to work.
If you just want all the fields out, you can run JSON.parse in a mapper for example
JSON.parse('[{' + $actions_values_json + '}]')
If you want to work with specific objects from the string, it could look like this:
jsonPath(JSON.parse('[{' + $actions_values_json + '}]'), "$[*].AddressLine1")
01-02-2020 07:06 AM
Thank you Karlsson 😀