Deserializa json

Hi folks!

Simply question. How would you deserialize this json?

{“id”:“44cdde5c-d9bb-438d-a09e-f1734ee93286”,
“articles”:[
{“articleId”:133414,“quantity”:1},
{“articleId”:114077,“quantity”:1},
{“articleId”:300831,“quantity”:1},
{“articleId”:301993,“quantity”:1}
]
},
{“id”:“b00239b7-11f6-448f-bb75-00627480f172”,
“articles”:[
{“articleId”:353825,“quantity”:1},
{“articleId”:158651,“quantity”:1},
{“articleId”:333579,“quantity”:1}
]
}

Thank you guys,
regards

before we can proceed, we have to correct the json, done with Json LINT

[{
	"id": "44cdde5c-d9bb-438d-a09e-f1734ee93286",
	"articles": [{
			"articleId": 133414,
			"quantity": 1
		},
		{
			"articleId": 114077,
			"quantity": 1
		},
		{
			"articleId": 300831,
			"quantity": 1
		},
		{
			"articleId": 301993,
			"quantity": 1
		}
	]
}, {
	"id": "b00239b7-11f6-448f-bb75-00627480f172",
	"articles": [{
			"articleId": 353825,
			"quantity": 1
		},
		{
			"articleId": 158651,
			"quantity": 1
		},
		{
			"articleId": 333579,
			"quantity": 1
		}
	]
}]

does this represent your JSCN data?

then we can parse as a JArray like:
grafik

with the help of UiPath.WebApi.Activities

1 Like

UiPath.WebAPI.Activities library has JSON activities and functions.

Thanks sir,

What kind of output argument has your deserialize activity?

Regards

grafik
When clicking on the output fiield and typing STRG+K a new variable of the correct datatype will be created. The datatype will be

grafik

ensure: UiPath.WebApi.Activities is added to the project via the package manager

1 Like

That’s what I needed, thank you @ppr

Mio problemo (:slight_smile:) is I used Deserialize activity instead Deserialize Array.

Cheeeers :champagne:

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