Merge two collections with 1 unique field

MaxKMan

New Member
Hi Everyone,

I have two collections.

Col 1
Number Birth Month Birth City
012512 JAN NYC
012513 FEB CAL
012514 MAR CHI

Col 2
Number Name
012512 JON
012513 MARK
012514 ANNA

Final Outcome should be
Number Birth Month Birth City Name
012512 JAN NYC JON
012513 FEB CAL MARK
012514 MAR CHI ANNA

How can I do this using collection manipulation?

thank you
 

gil.silva

Active Member
Hello,

You can use the action Merge Collections, from the Utility - Collection Manipulation.
Keep in mind that the output collection should be a different one, otherwise an error will occur
 

SriLakshmi

New Member
Hello,

You can use the action Merge Collections, from the Utility - Collection Manipulation.
Keep in mind that the output collection should be a different one, otherwise an error will occur

When we are merging 2 collections having1 common column and when you try to combine both collections using Merge Collections Action. Will be getting below error- No matter whether output collection is same or different.

Internal: Could not execute code stage because exception thrown by code stage: The column 'Office' already belongs to this DataTable.
 

Sachin_Kharmale

Active Member
Hi Everyone,

I have two collections.

Col 1
Number Birth Month Birth City
012512 JAN NYC
012513 FEB CAL
012514 MAR CHI

Col 2
Number Name
012512 JON
012513 MARK
012514 ANNA

Final Outcome should be
Number Birth Month Birth City Name
012512 JAN NYC JON
012513 FEB CAL MARK
012514 MAR CHI ANNA

How can I do this using collection manipulation?

thank you

Hi @MaxKMan ,

When we want to merge two collection that time we can not merge collection when same column name present in both collection,
If you want merge collection on above scenario then you need to remove Number Column from Collection 2 and Merge Collection 1 and Output collection which is obtain after deleting column from collection 2 then you will get desired output.

Design flow like bellow .
View attachment 1580206441468.png
I hope it will help you..!
 
Top