Use the ConvertStringToJson Activity
Note: Use caution when building or editing a workflow. For further advice or to arrange training, contact your professional services consultant.
The ConvertStringToJson activity can be used to convert an input string and return a JSON (JavaScript Object Notation) object.
The ConvertStringToJson activity is located in the XML/Json section of the Tribal Toolbox.
Note: The minimum requirement for the ConvertStringToJson activity is InputString.
This activity contains the following relevant properties.
Section | This field | Holds this information... |
---|---|---|
Inputs | InputString | The input string to convert to a JSON object. |
Misc | DisplayName |
The title of the activity. Note: The DisplayName property is set to ConvertStringToJson by default. |
Outputs | OutputObject | The converted object. |
Clicking the ellipsis button adjacent to the relevant field opens the Expression Editor, where you can enter the relevant code in the Visual Basic (VB) format.
To use the ConvertStringToJson activity in a workflow:
-
Click the Tribal Toolbox tab in the XML/Json section of Workflow Builder.
-
Drag and drop the ConvertStringToJson activity into the desired location within the Sequence panel. In this example, ConvertStringToJson is followed by TrackingMessageActivity so that the output can be viewed.
-
Enter values for the InputString (for example: "{CPU: 'Intel',Drives: ['DVD read/writer','500 gigabyte hard drive'], IsActive:true}") and OutputObject (for example: jsonObject) fields and add a name for the activity to the DisplayName field. Click the ellipsis button adjacent to the relevant fields to open the Expression Editor.
Note: An exclamation mark symbol indicates a warning. Refer to Use the Warnings Panel for further information.
-
Enter values for TrackingMessageActivity fields, Key (for example: "JSON") and TrackingMessage (for example: JsonObject.toString()) fields and add a name for the activity to the DisplayName field.
-
Click Save.
You can now trigger the workflow and use the User Tracking tab to ensure that the input string is converted to a JSON object.
Note: Refer to Build a Workflow for a video describing how this activity can be used in a workflow.