Question: How to merge two data tables

MLKSDHA%5D9GG%7BQFEHQ6YG%5D%25U 8%24%7B%5DDHN0CQT%40S%24%60OU%5D%5DB3MA KPEU%7B)GQWU8QG5%5DO%7BE%24)UUL

The number of columns in Table 1 and Table 2 is not necessarily the same.
Please help me and tell me what I should do.

Use merge datatable activity

Check this link

Hi @kalyanDev

Merge Data Table activity won’t work in the use-case of @zyy_zero considering that the column names are not the same :slight_smile:

3 Likes

Then better use .net method dt.Merge(dt2) this work if columns are different

I dont think that would work too.

My suggestion is to create a new table, do a for each loop for every dt and add it row by row to the new dt

1 Like

hi @ross1 that .net method will work 100%

I’ve tried this method, but it always turns out like this.
HHEO%40%5DCJALX2X_H%5D%25HVNP(C

1 Like

I’ve thought about this method.But I want to find a less time-consuming way.

Try this way DT.Merge(t2, false, MissingSchemaAction.Add); check once else properties of that methods then you get

Hi @zyy_zero

Use invoke method activity
Dt1.rows
Merge

Thanks
Ashwin.S

Hey @kalyanDev,
I also want to know the fastest way of solving this kind of use case :slight_smile:

However, there is an error:
image

3 Likes

Hello, Take a read range activity to read both input excel data and store in a data table and then take merge data table activity and from properties panel, select “Add” in missing schema action and enter data table variable in related field.

Please let me know if it works.

Thank you for your answer, but my question is to merge tables when listing and other items are not identical.

Why don’t you try rest of Missing Schema action of Merge Data table activity?

I’ve created this solution to your problem. The solution is dymanic (it will work even if you continuously update you columns in both DataTables). Attached you will also find the workflow :

1 Like