Automation Action: Create JSON
Create a Json Document and assign it to a variable.
Create Json text and assign variables to each Json element. The resulting Json text can be assigned to a variable for use on subsequent actions.
You first need to enter or paste valid Json text in the Enter Or Paste Json Here To Parse entry. You need to obtain the Json schema that you want to update and copy/paste into this entry. Then click the Parse > button.
The Json will be parsed and all elements will be listed in a tree structure.
Select each line in the tree in turn. The Selected XPath, Element and Type will be shown as you select each entry.
In the Set To Value entry enter or specify the data that you want to be assigned to the selected entry. Fields/Variables can be specified here. Then click the Update button. The updated Json will be shown in the Preview Result view. Repeat for each element that you want to update.
In the Assign Json To list select the variable you want to resulting Json assigned to. If the Compact option is enabled then the Json will be returned in compact format, otherwise it will be formatted and indented.
When the message is processed each element in the Json will be assigned the value you specify and the resulting Json assigned to the specified variable.
This Json can then be used on other actions by referencing this variable.
You can also use the Update Json and Set Variable actions to manually create Json. The Set variable text can contain %variable% replacements. When ThinkAutomation replaces values during Automation execution it checks if the value is being replaced inside Json - and if so the replaced value will be Json 'escaped'. See: Json Notes.