JSON Functions

Varsha Neelesh
Varsha Neelesh
  • Updated

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:

1. Enter a Display label for the node. This will be helpful with identifying the node when viewing your Entity Pipeline.

2. Enter a Description that will explain what the function is configured to do.

3. In Input json provide the input attribute 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:

You can configure the Display Label, Description and Input JSON by providing the input attribute or token that contains the string json on this function. There are no other configurable attributes. 

Example:

The input string, `{"name":"sfdcid", "value":"003PX000007wWl4YAE"}", will be returned as an object.

 

Convert To JSON String

This function converts the input value into a JSON String

Configuration:

You can configure the Display Label, Description and Input Value by providing the input attribute or token. There are no other configurable attributes. 

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. 

Share this

Was this article helpful?

0 out of 0 found this helpful