Merge 3 datatables into one

Hello guys. I have 3 data tables with the same headers. I need to merge the 3 datatables to one. How can I achieve that? Thanks!

How to merge more than one datatables using LINQ using Uipath - News / Tutorials - UiPath Community Forum

2 Likes

@Povilas_Jonikas
use merge datatable activity

e.g. you have dt1, dt2, dt3

use two merge datatable activities

source = dt2
target = dt1

  1. source = dt3
    target = dt1

now dt1 contains merged result of dt1,2,3

1 Like

Thanks a lot to both of you! :slight_smile:

1 Like

Hi @Povilas_Jonikas

You can merge by
DT1.AsEnumerable().Union(
DT2.AsEnumerable().Union(
DT1.AsEnumerable(),DataRowComparer.Default),
DataRowComparer.Default).CopyToDataTable()
OR
You can use Merge Data Table Activity for two times.

Hope this will help you to understand better.

Cheers!

1 Like

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