#BPTechTips How to quickly copy collections ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-06-21 03:02 PM
Looking to make a copy of a collection and searching the Actions in Collection -Manipulation ?
There is a simple way to do that without using any VBO
Just use the calc stage to copy values from one collection to other collection
------------------------------
Harshit Rawat
Senior RPA Consultant
------------------------------
There is a simple way to do that without using any VBO
Just use the calc stage to copy values from one collection to other collection
------------------------------
Harshit Rawat
Senior RPA Consultant
------------------------------
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-01-23 03:39 AM
Hi @Harshit Rawat
Does this only works for collection with same number of column or can be used even with different number of columns? If not, how to copy certain column in a collection into another collection?
Thanks
------------------------------
Nafiz Zainal
------------------------------
Does this only works for collection with same number of column or can be used even with different number of columns? If not, how to copy certain column in a collection into another collection?
Thanks
------------------------------
Nafiz Zainal
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-01-23 06:30 AM
Hi Nafiz,
The method described merely creates an exact copy of the original collection. It copies all rows, there is no option to copy part of the collection. Of course, there are already VBO's and actions to copy only part of a collection, but the method described by Harshit does not do that.
If you take the time to test Harshit's nice idea, you'll find that if the ToCollection is undefined, it will get all fields and content from the FromCollection. If the ToCollection already has fields, these must be an exact match to the FromCollection fields, otherwise it will throw an exception.
------------------------------
Happy coding!
---------------
Paul
Sweden
------------------------------
The method described merely creates an exact copy of the original collection. It copies all rows, there is no option to copy part of the collection. Of course, there are already VBO's and actions to copy only part of a collection, but the method described by Harshit does not do that.
If you take the time to test Harshit's nice idea, you'll find that if the ToCollection is undefined, it will get all fields and content from the FromCollection. If the ToCollection already has fields, these must be an exact match to the FromCollection fields, otherwise it will throw an exception.
------------------------------
Happy coding!
---------------
Paul
Sweden
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)
Paul, Sweden
(By all means, do not mark this as the best answer!)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-01-23 06:51 AM
Hi Paul,
Can you tell me which VBO's that can copy a particular column from one collection to a particular column from another collection? I still can't find the solution for this.
Thanks
------------------------------
Nafiz Zainal
------------------------------
Can you tell me which VBO's that can copy a particular column from one collection to a particular column from another collection? I still can't find the solution for this.
Thanks
------------------------------
Nafiz Zainal
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-01-23 07:45 AM
Hi Nafiz
I tried Harshit's idea on one column, but that did not work.
Fastest I could find is to copy the collection using the fast copy above, then remove the columns you don't need with action 'Delete Column' from object 'Utility - Collection Manipulation Extension'.
Alternatively, you could loop through your FromCollection while adding whatever data you need to the ToCollection. This would be a row-by-row operation and therefore perhaps not so fast if you have large collections.
------------------------------
Happy coding!
---------------
Paul
Sweden
------------------------------
I tried Harshit's idea on one column, but that did not work.
Fastest I could find is to copy the collection using the fast copy above, then remove the columns you don't need with action 'Delete Column' from object 'Utility - Collection Manipulation Extension'.
Alternatively, you could loop through your FromCollection while adding whatever data you need to the ToCollection. This would be a row-by-row operation and therefore perhaps not so fast if you have large collections.
------------------------------
Happy coding!
---------------
Paul
Sweden
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)
Paul, Sweden
(By all means, do not mark this as the best answer!)