How to format nested collection in Blue Prism
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-12-19 11:31 AM
Hello,
I am retrieving some information with Blue Prism from one API, and I receive a collection as the output. The problem is that I do not want my collection to look like this. I want to receive one collection with one row where I will have all of the employees listed, not 1 employee per 1 collection. Now I'm getting a collection with many nested collections, and each of them has 1 row. I tried to use a loop with utility collection manipulation - Copy rows and also Collections - Copy Rows, but it did not work. Could anyone tell me, how can I format my collection to get only 1 collection with all of the information in it, please?
https://imgur.com/a/NhCjf5m
Best regards
------------------------------
Patryk
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-12-19 12:32 PM
If you are on Blueprism 6.4 + , you can use the Webservice option in settings to get the response and use the JSON Path to extract every employee as a 1 employee per row.
Try using JSON path.
Thanks
------------------------------
sanjeev rout
Advanced App Engineering Specialist
Accenture UK
Europe/London
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-12-19 01:53 AM
How about getting the response in a JSON String and then use the JSON de-Serialization as per your need?
------------------------------
Vivek Goel
RPA Architect
Asia/Singapore
https://www.rpatools.com/
"If you like this post, please press the "Recommend" Button.
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
13-12-19 01:05 AM
You'd loop through with Loop stages on the 0_Results collection, and then use some method to add the row to a new collection like [0_Results.JSON:Array] in a calc stage or I suppose you could append rows to collection (Collection manip VBO).
It sounds like you were on the right track, but copy rows wouldn't be the way to go because it overwrites the data in the output collection. Use the Append action in the Collection Manipulation VBO.
You could certain go the route that others suggested and convert to JSON instead. That would likely run much faster than looping through all the rows to extract the nested collections. So it's really up to your preference.
------------------------------
Dave Morris
3Ci @ Southern Company
Atlanta, GA
------------------------------
Dave Morris, 3Ci at Southern Company
