cancel
Showing results for 
Search instead for 
Did you mean: 

Merge Collection in BP

sapna_soni0290
Level 5

Hi Team,

I want to understand how Merge collection works in BP.

I am having collection c1 (9 rows, two columns-A & B) and coll c2 (42 rows . column C & D). All colms are different.

When i use merge collection, it should add all 42 rows & 4 cols, right?

But i am getting it as only 9 rows.

While in other scenario i had 1 row in c1 & 8 rows in c2, it could add all 8 rows.

What can be the issue here? can someone please help.

1 BEST ANSWER

Best Answers

Daniel_Sanhueza
Level 7

Then what if you write those collection on Excel in the order that you want, then you retrieve all the data?

I know this isnt optimal and while I reply on this I'm thinking of how you will know that the value on row 5 of collection 1 should be merged on row 5 of collection 2, but anyway, using excel perhaps may do the trick.

Daniel Sanhueza
RPA Professional Developer
Deloitte

View answer in original post

6 REPLIES 6

MichealCharron
Level 7

@sapna_soni0290 

The "Merge Collection" action, in BP's "Utility-Collection Manipulation" VBO, does the following:

  1. Adds the columns from Collection 2 into Collection 1.
  2. Loops through all the rows in Collection 1 and copies the values from the corresponding values from the rows in Collection 2 to the new corresponding columns in Collection 1.

Collection 3 (output) will always have the same number of rows as Collection 1 but with the sum of the number of columns from both Column 1 and Column 2.

 

Micheal Charron
RBC
Toronto, Ontario
Canada

Thanks Michael for replying.

So u mean if my coll1 - 10 rows & coll2 - 5 rows, coll3 will have 10 rows

If coll1 - 5 rows & coll2 - 10 rows, coll3 will have 5 rows ?

I understood the reasoning that it will add columns of both.

Want to know about total rows in output. so it will have coll1 rows in output as total rows?

If this is the case is there any way i can merge both & have total rows of the  collection which has max rows ?

 

Hello!

I guess count both Collections and the one with most rows treat it like Collection 1. if the position of columns doesnt bother you (or multiple Blank rows) might be the best option.

Regards

Daniel Sanhueza
RPA Professional Developer
Deloitte

sapna_soni0290
Level 5

Hi daniel, 

Thanks for replying. Position does both me and I have 4 different collection which I want to merge. Each collection will have 2 cols and rows can range between 0 to anything. 

Any solution? 

Daniel_Sanhueza
Level 7

Then what if you write those collection on Excel in the order that you want, then you retrieve all the data?

I know this isnt optimal and while I reply on this I'm thinking of how you will know that the value on row 5 of collection 1 should be merged on row 5 of collection 2, but anyway, using excel perhaps may do the trick.

Daniel Sanhueza
RPA Professional Developer
Deloitte

I could use this suggestion of excel for now & i will have to just copy my collections to A1, C1, E1 etc & then i will read it back.

This approach works for now but if someone has more optimal solution, please let us know.

Thanks Daniel for helping out.