The comparing of the two datatables and finding the matches works but the issue is with the updating the column “Match Found” it inputs wrong values as you can see below
If same excel and you are using excel application scope, you can simply write a IF formula for that column element and that eill be populated.
If you need to do it at data table level, once you get the join datatable, you can use for each datarow and compare those two values and accordingly put the value in the last column
The problem in your code is that you are using two loops which is not required.
If you want to compare the first column with SCN then find the below xaml
Have updated your xaml and attached for your reference Main.xaml (12.8 KB)
But why still I need some clarity @Geetishree Rao why I was looping two datatables because I wanted to compare the column in the dt_B13 datables with my newly created joined datatable.
If you are joining the tables and getting the data into one table then you need not add two loops to compare the data, as the joined table has all records from both the tables(as you are comparing columns from the joined table)
You loop through all rows of the joined table and update the Match column as I have shared in the xaml.
Could you elaborate your requirement to check that we are on the same line:
-Join Condition (column name and excel name)
-Match condition