Some business processes may consume the JSON as an input/output to exchange data to/from a web server.
When receiving data from a web server, the data is always a string.
Let’s explore how to extract the field from a JSON string!!!
Implementation using UiPath :
Let us implement a workflow which consumes a JSON string and extracts the required fields.
Drag “Assign” activity into the designer panel and assign some JSON string as shown below.
Drag “Deserialize JSON” activity into the designer panel to deserialize a JSON string. Supply the variable “json_Data” to it as input and create a variable called “out_Json” of JsonObject type.
Drag “Message Box” activity into the designer panel to display the “Fruit Name”.
Similarly, we can extract any number of required fields by passing the names of the appropriate tokens 🙂
Finally, let’s run the project to display the “Fruit Name”.
Click here to download the Source Code…
Hope it has helped you…