Have Questions?  Need Expert Answers?  JOIN LUNCH N' LEARNS!

JSON Serialization

Prev Next

Step Details

Introduced in Version3.2.0
Last Modified in Version8.9.0
LocationData > JSON

The JSON Serialize step changes a data object into a JSON string via serialization. This step is best used to assist in utilizing modern REST web services to send or receive data. The object is chosen via the Type drop-down, where a user must pick the data type for the serialized object and the Object to Serialize input, where the user picks the specific object.




Properties

Parameters

PropertyDescriptionData Type
TypeThe data type that will be serialized can be a User Defined type or a default Decisions type.
---
Ignore Null
When enabled, any null values encountered in the data object will be ignored during serialization. Null properties will not be included in the resulting JSON string.
Boolean
Is ListChanges the input to expect a list.Boolean
IndentedApplies indenting format to the output data to enhance readability.Boolean

Inputs

PropertyDescriptionData Type
Object To SerializeThe input variable expects an object from the user-selected type.---

Outputs

PropertyDescriptionData Type
JsonSerialize1_Output
The default variable that stores the JSON serialized type.
String
Error Message
Output variable for the step error message
String



Example 

  1. In a Designer Project, click CREATE FLOW on the Global Action Bar and click Flow. Name the Flow and click CREATE.
  2. Click and drag the Fetch Entities step to the workspace. Connect the step to the Done path of the Start step. Click the Type Name dropdown list under the ENTITY FETCH DEFINITION category on the Properties panel. Enter "account" in the search box and click Account [DecisionsFramework..].
  3.  Click the Results path and navigate to All All Steps [Catalog] > Data > Json. Select the Json Serialize step and click ADD.
    To create an example with XML and XSD, add the Xml Serialize or the XSD serialize step and click on the Readable XML Output under the OPTIONS category.

  4. In the Type dropdown box enter "account" and select Account [DecisionsFramwork].
  5. Click Unknown next to Object to Serialize field and select Select From Flow. Then, click Entity Results [Account[]] and select Last [Account]. Then, click DONE.
  6. Connect the Done, Error, and No Results path to the End step. Click Save on the top action panel to save changes.


Debug

  1. On the top action panel, click Debug. Then, click START DEBUGGING.
  2. After the Debugger runs, click the Json Serialize 1 step, select Execution 1, and click View Output Data.
    The serialize step has changed the type into a JSON Serialized String
Related Information

Forum Posts:
Json Serialize
Backslash (\) Included In JSON Serialize Output