How to merge two datatable with different headers & Range

Hi,

I have a two datatable DT1 & DT2 with different headers & Range.
Tried to join both datatable by using the merge activity.
But getting output once the DT1 values completed , End of next row merging DT2 values.

Can someone assist me on this please. Thanks !!

Hi @jamuna_T

Can you try the below

A "Build Data Table" dialog box is displayed with columns for "Amount," "Name," "Value," and "Place," each defined as string data types, and buttons for adding or removing rows and columns. (Captioned by AI)

DT_Output = (From row1 In DT1.AsEnumerable
 Join row2 In DT2.AsEnumerable
 On DT1.Rows.IndexOf(row1) Equals DT2.Rows.IndexOf(row2)
 Select DT_Output.Rows.Add(row1("Amount"),row2("Name"), row2("Value"), row2("Place"))).CopyToDataTable

Output:

The image shows an Excel spreadsheet with four columns labeled "Amount," "Name," "Value," and "Place," containing three rows of data with numerical, text, and alphabetical values. (Captioned by AI)

Regards,

1 Like

Hi @jamuna_T

Please find my attached solution and let me know if it’s working
JoinDatatable.zip (113.8 KB)
Please mark as solution if its working!

Thanks
Akash Javalekar

1 Like

Hi @Akash_Javalekar1
Its working as expected. Thanks a lot!

Great I am glad to help you!

Happy Automation

Please mark as solution

1 Like

I marked as a solution. Thanks!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.