Convert To JSON String Function

Simran Mehndiratta
Simran Mehndiratta
  • Updated

Function Name:

Convert To JSON String

Purpose:

This function converts the input value into a JSON String

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 Value provide the input attribute 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. 

Share this

Was this article helpful?

0 out of 0 found this helpful