cancel
Showing results for 
Search instead for 
Did you mean: 

Deserializing JSON object to collection

Anonymous
Not applicable
Hi, On hitting  a web api service, a json response is being returned.Json response returned has collections within collections. {"id": 123,"iteminfo":{inputs:[]}, {"id":456 ,"iteminfo:{"model":"xyz","Results":[]}}, {"id":789,"iteminfo:{"Type":1,"Results":[{"Files":[],"From":abc]} as it can be seen iteminfo attribute has different values for all ids and can even have nested collections  in it.How do i decide till what levels do i need to loop in the main collection as properties of iteminfo are different for all ids.
1 REPLY 1

Hi Aashima,

You can do a number of things depending on your desired output.

If you want to call certain nested collections you can just the dot notation e.g. [results.id.iteminfo] 

If you are able to pre-define all potential fields in these collection so that when populated they can be half filled decision stages that check whether a field is empty will help you in your process.

Best Regards

------------------------------
Ronan Considine
------------------------------
Ronan Considine Senior Business Analyst Blue Prism