cancel
Showing results for 
Search instead for 
Did you mean: 

Split Collection by row

vinodchinthakin
Level 9
Hi All,

I am looking for a solution to Split a collection by row. For Example  I have to split the collection of 15000 records to two collections each with 7500 records.
Do we have any customized code?


------------------------------
vinod chinthakindi
------------------------------
4 REPLIES 4

ewilson
Staff
Staff
Hello @vinod chinthakindi,

Take a look at the Utility - Collection Manipulation VBO.​ It includes a Split Collection action. You can find the latest version on the DX at the link below:

https://digitalexchange.blueprism.com/dx/entry/3439/solution/utility---collection-manipulation

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Hi @ewilson. "Split Collection" action from above VBO helps to split collection based on Columns.(predefined in templates)
My requirement is to split collection based on Rows. ​
I have to split the collection of 15000 records to two collections each with 7500 records. Two collections has same columns.
Could you guide how it can help me. 
Thanks!

------------------------------
vinod chinthakindi
------------------------------

@vinod chinthakindi,

Ah, you are correct. Got ahead of myself. 😳 There are a couple ways you could do this based on rows. You could use the Copy Rows actions to copy the first half of the main collection into a new collection (Start Row = 0, Number of Rows to Copy = 7500) and then call it again with Start Row = 7500, Number of Rows to Copy = 7500).

Alternatively, you could use a Code stage in a VBO to split the underlying DataTable. The following article on Stackoverflow has some examples.

https://stackoverflow.com/questions/34663933/split-datatable-into-multiple-fixed-sized-tables

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Thanks Eric for sharing the article. I will give a try.

------------------------------
vinod chinthakindi
------------------------------