I apologize, I thought the merge method would add the rowindex automatically, but you have to do that yourself manually.
‘add datacolumn activity’ do this twice - once for dt1 and once for dt2. Add a column called RowIndex1 for dt1, and RowIndex2 for dt2
For each row in dt1 // Be sure to use the output in the properties pane and create an int32 variable called CurrentRowIndex
Assign row.item(“RowIndex1”) = CurrentRowIndex
Now repeat the for each row for dt2
Use the Join Datatable Activity to inner join dt2 to dt1 on dt1(“RowIndex1”) = dt2(“RowIndex2”) and save as dtMerged
‘Remove datacolumn activity’ - use 2 of these to remove the “RowIndex1” and “RowIndex2” columns from dtMerged
Now you have a merged datatable. Note that if you have different amount of rows between the datatables, any extra from dt2 will be excluded, and any extra from dt1 will have the dt2 columns be null.
NOTE: You could do this with LINQ instead which would remove some of the steps of adding/removing columns, but this way uses all built-in activities which can be much easier to maintain for people who are new to .NET
Here is the .xaml doing what I mentioned above: delete4.xaml (12.2 KB)