Need help merging 2 data tables

Hi All,

I need help with the following:

Table 1:

|ID|FirstName|MiddleName|LastName|BirthDate|
|101|Jane|D|Doe|1/1/2020|
|120|John|R|Doe|1/2/2020|
|132|Mary|K|Jane|1/3/2020|
|123|Alex||Wayne|1/4/2020|
|143|Mary|Kate||1/5/2020|

Table 2:

|ID|FirstName|MiddleName|LastName|BirthDate|Address|City|
|123|Jane|D|Doe|1/1/2020|123 Random St|Charlotte|
|111|John|R|Doe|1/2/2020|111 Fake Court|Peachtree City|
|132|Mary|K|Jane|1/3/2020|100 Direction Lane|New York|
|123|Alex||Wayne|1/4/2020||Paris|
|143|Mary|Kate||1/5/2020|444 Nowhere Road||

Final Output:

|ID|FirstName|MiddleName|LastName|BirthDate|Address|City|
|101|Jane|D|Doe|1/1/2020|||
|120|John|R|Doe|1/2/2020|||
|132|Mary|K|Jane|1/3/2020|||
|123|Alex||Wayne|1/4/2020|||
|143|Mary|Kate||1/5/2020|||
|123|Jane|D|Doe|1/1/2020|123 Random St|Charlotte|
|111|John|R|Doe|1/2/2020|111 Fake Court|Peachtree City|
|132|Mary|K|Jane|1/3/2020|100 Direction Lane|New York|
|123|Alex||Wayne|1/4/2020||Paris|
|143|Mary|Kate||1/5/2020|444 Nowhere Road||

Any help is appreciated!! Thanks in advance!

Hi @dla0313

Use merge datatable activity.

Regards,

Hi @dla0313 ,
Try this

image

hope this helps.

Hi @dla0313

As @Pallavi_Shetty said you can try with Merge Datatable activity

This activity allows you to merge two data tables by specifying the data table to merge and the data table to merge into, as well as the columns to use for the merge.

Check out this thread

Regards
Gokul

Hi @dla0313,

Use merge datatable activity and in properties set additional columns to keep.

But every time I try to merge, I receive this error message: “Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.”

My data table has null values and duplicates but I still want everything to be there. How do I merge then? Wouldn’t it be a join?

But every time I try to merge, I receive this error message: “Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.”

My data table has null values and duplicates but I still want everything to be there.

Set the MissingSchemaAction property of merge datatable to “Add”.

But I received this error message: “Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.”

I want the null values and duplicates to remain in the data table.

That is what I did and received that error message.

Just make sure columns in datatable have data types which can have null value. For reference follow the link: https://docs.uipath.com/activities/other/latest/user-guide/manipulate-tables