The Convert JSON to Dictionary
action extracts the JSON data to a dictionary variable to help you read or
process different nodes individually. You can also extract individual nodes to specific
variables based on the data type.
For more information on how to use various JSON actions, see resources and Building an automation using JSON actions.
Note: When you extract JSON data to a dictionary variable, null values in
the JSON are dropped because dictionary variables do not support null values. Empty
strings ("") convert successfully.
About this task
The JSON data source defined in the Start
session action serves as the input for the Convert JSON to
Dictionary
action. Ensure that you use the same session name when configuring this
action.
Procedure
-
Enter the same session name or session variable used in the Start
session
action in the Session name field.
-
Choose from the following options in Assign output to a
variable field to save the outcome to a variable:
- Dictionary: Select a dictionary variable or
create one to hold the output.
- Multiple variables: Select this option to store
the output in multiple variables by providing the key and the variable to
which the key must be mapped.
The key you map to a variable must match the key in the JSON node.
Depending on the selection, the JSON data is now available either as a
single dictionary variable or as individually mapped variables.