We can get excel data in datatable using read range activity, lets say 1st excel data as dt1 and 2nd as dt2.
by using following code in assign you’ll able to get unmatched rows.
dt1.AsEnumerable().Where(Function(row) Not dt2.AsEnumerable().
Select(Function(r) String.Join("",r.ItemArray)).Any(Function(x) x = String.Join("",row.ItemArray))).
CopyToDataTable()
And to get matched rows, just remove Not from the code.
Above code basically search for rows from dt1 into dt2, so to get common rows, there’s no problem but to get unmatched row you have to search rows from dt1 to dt2 as well as dt2 to dt1 and merge both data’s.
Here I’m attaching sample workflow for your better understanding —> DataRowCompare.xaml (11.3 KB)
Note —> first check both build data table’s data and then run the workflow. In first MessageBox you’ll have common rows and 2nd MessageBox with unmatched rows from both data.
Okay then, that means either your 2 files has no common data (Both data have different rows) or no unmatched row (Both data have similar rows)
So to handle this situation you must put those assigns in seperate Try-Catch assign should be in try and catch should contain messageBox to specifying no rows. (For testing)