Converting JSON To Dictionary Activity
The Convert JSON to Dict activity deserializes JSON file to Dictionary<Key, Value> object.
-
Convert JSON to Dict takes JSON text as input. Prefix the JSON text with '@'. Ex:
@"{'Name' : 'Example'}"
-
Using JSON file as input: Use Read JSON or Read Text File which reads JSON file and provides output as text. Send this text to Convert JSON to Dict
-
Convert JSON to Dict output Dictionary<Key, Value>. Key and Value can be of any data type.
Let us understand Convert JSON to Dict activity with an example process. Here is an example that takes JSON text as input and displays the converted dictionary as key and value.
Come, let's create this process in Process Designer:
Step#1
Launch and create a new process in Process Designer
- Launch Process Designer from the Windows Start menu located under IntelliBuddies Enterprise
Step#2
Create New Process
-
Click on New Process and fill in the new process details
Step#3
-
Add dictionary<String, String> variable.
Step#4
In Activity panel search for Convert JSON to Dict
-
Drag and drop Convert JSON to Dict activity to main panel
-
Add the JSON string
@"{'Even_prime' : 2}"
. Set the output to dictionary variable created above.
Step#5
-
Add Message Box.
-
Display the dictionary output obtained.
Step#6
Save the process
- From the Design tab ribbon, click on Save
Step#7
Run the process
- From the Design tab ribbon, click on Run
Step#8
Ensure the process executes and displays dictionary elements.
Download Example (C#)