Below is my Json file which i want to parse to get all the values in dictionary with keys and values as string . Getting Error in line 12 OUNew and LegalEntity .
{
“trackingnumber”:“ORA0000005806”,
“requestorEmail":"xyz@xyz.com”,
“requestorName”:“xyz “,
“supplierName”:“Uline”,
“supNumber”:“1068”,
“businessCenterId”:“United States”,
“isActiveSite”:false,
“supplierAddress”:“12575 Uline Drive Pleasant Prairie WI US 53158”,
“siteCode”:“1845046”,
“OU”:””,
“OUNew”:[
“101”
],
“LegalEntity”:[
“23273”
],
“activateBankAcc”:“”,
“inactivateBankSite”:“false”,
“inactivateBankAllSites”:“false”,
“supDBA”:“”,
“supCountry”:“US”,
“TaxPayerID”:“”,
“supTaxNo”:“”,
“supplierType”:“”,
“W2G”:“”,
“siteLedger”:null,
“liabilityAccount”:null,
“InactiveDate”:“”,
“supBusinessAddress1”:“12575 Uline Drive”,
“supBusinessAddress2”:null,
“supBusinessAddress3”:null,
“supCity”:“Pleasant Prairie”,
“supCounty”:“”,
“supState”:“WI”,
“supPostalCode”:“53158”,
“supAddressName”:“”,
“supPhoneNumber”:null,
“supFaxNumber”:null,
“supEmailAddress”:null,
“isRemitAddressDiff”:“false”,
“remittanceCountry”:null,
“remittanceAddress1”:null,
“remittanceAddress2”:null,
“remittanceCity”:null,
“remittanceStateProvince”:null,
“remittancePostalCode”:null,
“remittanceCounty”:null,
“remittanceAddressName”:null,
“Inactive”:“”,
“contactFirstName”:null,
“contactLastName”:null,
“contactDepartment”:null,
“contactEmailAddress”:null,
“contactPhoneNumber”:null,
“contactFaxNumber”:null,
“contacts”:[
{
“Inactive”:“”,
“contactFirstName”:“”,
“contactLastName”:“”,
“contactDepartment”:“”,
“contactEmailAddress”:“”,
“contactPhoneNumber”:“”,
“contactFaxNumber”:“”
}
],
“remittanceAddressContainer”:[
{
“remittanceCountry”:“”,
“remittanceAddress1”:“”,
“remittanceAddress2”:“”,
“remittanceCity”:“”,
“remittanceStateProvince”:“”,
“remittancePostalCode”:“”,
“remittanceCounty”:“”,
“remittanceAddressName”:“”
}
]
}
when this dictionary is needed we can do following:
whenever a complex datatype is occurring on the values we will serialize it for the dictionary value
also
remittanceAddressContainer,contacts… will be if the same case
Would this work for? If yes we can help for this
Please find the error i am getting
Kindly Help
in a prepared implementation of
doing this
JsonConvert.DeserializeObject(Of Dictionary(Of String, Object))(strJSON)
or
myJObject.Properties.ToDictionary(Function (x) x.Name, function (x) x.Value.toString)
How far is the result from your expected result?
Kindly note: string Json from value e.g. contacts can be deserialized later also as well
-
Check if your JSON is valid, for example here: https://jsonformatter.curiousconcept.com/
-
If is valid and Deserialize activity still does not work, a workaround is to try to convert it into a dictionary with an Assign activity:
JsonConvert.DeserializeObject(Of Dictionary(Of String, Object))(responseBody)
where responseBody is your JSON as string