How to convert Json to DataTable

hi all i need a help to convert json to Data Table Hear is my string i was getting this from Python script actually i need out put as data table but its not working so so converting the table to json in python and passing as string as out put so now in uipath this json needs to be converted in to Data Table

{“Quantity”:{“2”:“1.00”,“3”:“1.00”,“4”:“1.00”},“Product Code”:{“2”:“MISC”,“3”:“MISC”,“4”:“MISC”},“Description”:{“2”:“Command 7 Security Panel ADT7AIO-1 Wifi/Zwave”,“3”:“Command Converter 2G,DSC,Honeywell ADTCONVERT”,“4”:“Command LTE Radio ADTLTE-A”},“Cost”:{“2”:“$0.00”,“3”:“$0.00”,“4”:“$0.00”}}

Please don’t post repeat questions because you didn’t search first.

https://www.google.com/search?q=uipath+convert+json+to+datatable+site:forum.uipath.com&safe=active&rlz=1C1GCEA_enUS956US956&sa=X&ved=2ahUKEwiR497BkubzAhWIVTABHbUlBc8QrQIoBHoECAgQBQ&biw=1920&bih=937&dpr=1

I searched @postwick but nothing gave the success so posted in this are you able to convert that string to data table…?

They do give the answer which is to use the UiPath.WebAPI package and its JSON utilities to convert to a JArray. Then you can loop through that array and add each item to a datatable.

This doesn’t make sense to me. You should set it up so that the JSON contains each item then the properties (ie quantity, description, cost) for each item.

{ “Command 7 Security Panel ADT7AIO-1 Wifi/Zwave” : {“Quantity”: 1, “Product Code”: “MISC”,“Cost”:“$0.00”}… etc

@postwick it would be really helpful if you can guide me how to do that i am very new to this activities please

Start here.

@postwick i think the string format i self is different in my case i think

@bpt.teja1996

in case of JSON should converted to datatable below
grafik

Have a look on following starter help, dynamicly driven when converting to the datatable:
MergeJObjectsPropsToDT.xaml (11.6 KB)
data.json (295 Bytes)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.