JSON Functions provide a way to convert string json to list and objects.
Parse JSON To List
Assuming the input string is a valid JSON, this function converts the string to a list of records that can be looped upon.
Configuration:
Provide the input field or token that contains the string json.
Example:
The input string, `[{"name":"sfdcid", "value":"003PX000007wWl4YAE"}]", will be returned as list containing an object.
Parse JSON To Object
Assuming the input string is a valid JSON, this function converts the string to a an object containing key/value pairs.
Configuration:
Provide the input field or token that contains the string json.
Example:
The input string, `{"name":"sfdcid", "value":"003PX000007wWl4YAE"}", will be returned as an object.
Convert Value To JSON
This function converts the input value into a JSON String
Configuration:
Provide the input field or token.
Output:
The Output is a dictionary with the following structure:
{
"success": true|false, // false if there was an error converting the value to a JSON String
"jsonString":"<json string representing the value>" // This can be used as an input to the other Parse functions to parse it back to a JSON Object
"error": "<error message>" // Set only if there was an error converting the value
}
You can use {{previous.success}} in a decision node to check for errors.
Example:
If the incoming value is a basic type like string, number or date, the JSON string will be of the form
{
"value": <incoming value>
}
If the incoming value is an object, a JSON string representing the object will be returned.