JSON Help

Hi All,

Im working with a JSON response that has something like the below. Im trying to work through to find the key and value values. I’ve managed to get down to the page and keyValuePairs level but theres still several Jarray levels to go through. Is there an easier way to get the “key” and “value” values then iterating through several for each loops?

{
"transaction id": "111234"
"pages": [
	{"pageNumber" : "1"
	"status" : "succesful"
	"keyValuePairs" : [
	 [ [ {"key":"title"
	     "value": "title 1"
	     "confidence": "0.97"} ] ],
	 [ [{"key":"owner"
	     "value": "owner 1"
	     "confidence": "0.92"} ] ]
        ] } ] 
}

after correcting your JSON (inserting the property seperating commas) we deserialized it (Deserialize JSON from UiPath.WebApi.Activites)

Have a look on the SelectTokens method while using a relative selector expresseion to key, value (similar to a XPath //key statement)

grafik

2 Likes

This works like a charm. Thank you!

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