Deserializing JSON object to collection
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
25-05-19 09:56 PM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
24-07-20 04:49 PM
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
------------------------------
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
