I want to create the below json array from a group of arrays what would be the best way to go about this. i tried a for each loop but it overwrites the first instance.
“CompaniesInfo”: [
{
“CompanyId”: 138,
“CompanyInfo”: {
“Score”: “123”,
“DocumentKey”: “76149”,
“DocumentUrl”: “Test .pdf”,
“IsSuccess”: “”,
“Comment”: “”
}
},
{
“CompanyId”: 139,
“CompanyInfo”: {
“Score”: “456”,
“DocumentKey”: “76149c7b”,
“DocumentUrl”: “Test df”,
“IsSuccess”: “”,
“Comment”: “”
}
}
]
Have you used Deserialize Json array @duaine.b ?
Regards
Sudharsan
Hi i wanted to create the Json array using the array value. Because the json array doesn’t exist i can’t reserialise
Okay @duaine.b
Checkout this Video and the thread for multiple suggestions you can try this
Hello,
In this video I do a lot of stuff with JSON Chapter included:
All you need to know about JSON and UiPath, 4 different cases of parsing JSON also the creation of the Same JSON also JSON to Datatable, and DataTable to JSON.
[UiPath Tutorial for JSON Parsing and Creation | 8 UseCase]
0:45 Install Deserialize JSON
1:10 Present all types of JSON that will use
1:35 Deserialize simple JSON
2:50 Deserialize a JSON with an Object inside
3:55 Deserialize a JSON with Array insid…
Regards
Sudharsan
Hi @duaine.b
You can try this approach
dictCompanyInfo = New Dictionary(Of String, Object) From {{"Score", in_arrayScore(indx).ToString}, {"DocumentKey", in_arrayDocumentKey(indx).ToString}, {"DocumentUrl", in_strDocumentUrl}, {"IsSuccess", in_arrayIsSuccess(indx).ToString}, {"Comment", in_arrayComment(indx).ToString}}
xaml for reference
JSON_ArrayToJSONArray.xaml (12.6 KB)
CAUTION: take care of the index out of range exception