Barani_G1
(Barani G)
September 6, 2023, 5:54am
1
There is a error occurring when i try to converting the json to data table
( Error converting value “” to type ‘System. Double’.) error image is given below for the reference (if there is any empty value in json this error is occuring )
{
“Sheet1”: [
{
“PO issue date”: 45108.0,
“Supplier”: “UCIC”,
“IDH”: 2760618.0,
“DESCRIPTION”: “DAC Base 6x3L outer”,
“QTY”: 6000.0,
“PO”: 4576573931.0,
“03.07.2023”: “”,
“04.07.2023”: 6000.0,
“05.07.2023”: “”,
“06.07.2023”: “”,
“Location”: “copacker”
},
{
“PO issue date”: 45108.0,
“Supplier”: “UCIC”,
“IDH”: 2037166.0,
“DESCRIPTION”: “SHIP_BORD-S *Persil 2036250(Ctn Persil Black 6x3L relaunch - 15)”,
“QTY”: 5000.0,
“PO”: 4576573931.0,
“03.07.2023”: “”,
“04.07.2023”: “”,
“05.07.2023”: 5000.0,
“06.07.2023”: “”,
“Location”: “copacker”
},
Vikas_M
(Vikas M)
September 6, 2023, 5:57am
2
Hey @Barani_G1 ,
Refer the below thread and the video
Hi @Joeysugar You can use “Deserialize json” activity to convert the json to Datatable and then push the datatable to Excel file using “Write Range” activity. In order to convert the json (output of http request) in datatable, you can specify the “TypeArgument” of “Deserialize json” activity as “System.Data.Datatable”. Once you change the type, you can get the output as datatable. Please see the screenshot attached.
[convert%20json%20to%20Datatable]
Gokul001
(Gokul Balaji)
September 6, 2023, 5:58am
3
Hi @Barani_G1
Welcome to UiPath community
Check out this video. hope it will helps you
Regards
Gokul
@Barani_G1 Please find this thread. Hope it will help.
Please it’s urgent guys,
Can anyone please help me for converting json array into datatable ? MY array format is different for each key value.
Thanks in advance.
Regards,
Hemal
Hi @Barani_G1 ,
Could you let us know what was the method applied ?
Could you also check if you could switch to a Direct Conversion to Datatable method like below :
Newtonsoft.Json.JsonConvert.DeserializeObject(Of Datatable)(jObj("Sheet1").ToString)
Here, jObj
is the Output of a Deserialize Json
activity to which the input Json String was provided.
Debug Panel :