Hi Everyone, I have a json file i want to convert that json data into excel data. I’m unable to extract few details. Can anyone help me how to solve this. I’m attaching json file and my required output below.
1- Use build datatable activity for creating data table.
2- read json file store it into string variable(jsonString).
3-use for each loop like this split(jsonString,Environment.NewLine)
4- use If condition to check specified string for example id (if string.contains id)->than
5-use assign variable to store value into variable ->split (string,“:”)(1)
6-When you get values of all variable then use add data row activity to add data into datatable.
We do use the serialize JSON Acitivity form UiPath.WebApi.Activities
Prepare the target datatable structure with Build DataTable Activity
Deserialize the JSON string
Iterate over the blocks by:
For each activity - item in myJObject.SelectToken("*.addData:AdditionalInfo.*.addData:Blocks").Values(Of JOBject)
Alternate: myJObject.SelectToken("..addData:Blocks")
Type Argument: JObject
Within the loop acces
the id by: item("@Id").Value(Of String)
Left by item.("addData:Block")("addData:Rect")("@Left").Value(Of String)
like left
collect within each loop the values of intererst andd add it to the datatable
@ranaprathap928
please share with us what was used for the for each value - yellow mark in screenshot above:
for left it was mentioned:
also take note on
you used item(“@Id”).toString which has a different meaning
Just try to read carefully the posts with the help when implementing. This will lead you faster to the working bot and reduces ping-pong. Thanks for support