JSON Parse
Use this action to convert a JSON string into an object.
Using the JSON Parse Action
To use this action in your workflow, connect it to ThingWorx Flow. To connect to the flow, do the following:
1. Click and drag the JSON Parse action under the JSON Tools utility to the canvas, place the pointer on the action, and then click or double-click the action. The JSON Parse action window opens.
2. Edit the label name, if needed. By default, the label name is same as the action name.
3. In the Add JSON field, enter the JSON string to convert it into an object. To add multiple JSON strings, click Add.
4. In the Throw Parsing Error field, select an option from the list. If you select true and input JSON has some invalid JSON, the action fails with a parsing error. If you select false and the action input has some invalid JSON, the action does not fail.
5. Click Done.
For example, the JSON string that is to be converted into an object is as follows:
{ "Name": "John","Age":15,"isEmployed":true, "Address":{"City":"Pune","Country":"India"}}
When you enter this value in the Add JSON field, and then execute the workflow, the output is as follows:
"Name": "John",
"Age": 15,
"isEmployed": true,
{ "City": "Pune", "Country": "India" }
Output Schema
The JSON Parse action returns an output schema as shown in the figure that follows: