How to find and send mail for records in one table that are not in the other table

Hi everyone,

I have 2 datatable.
If one of the records in the first datatable is not in the second dattable, I want to send an e-mail.

I wrote row1.Item(1) = row2.Item(1) in the if activity, I tried to put the mail activity in the else part. But when I do this, it sends mail for each datatable row.

Is there anyone know how can I solve this situation?

@mazlumkacar You need to get the UnMatching rows in Datatable 1 if I’m not wrong ? Then send the emails for those many number of rows ?

Hi @mazlumkacar

use if condition

row1.item(1).equals(row2.item(1)

in then condition use build data table and use add data row and then use append line activity with send outlook mail activity

Thanks
Ashwin S

@mazlumkacar You can get the UnMatching Rows from 2 Datatables using this query :
Assign DT = DT1.AsEnumerable.Except(DT2.AsEnumerable,DataRowComparer.Default).CopyToDataTable

1 Like

@AshwinS2

When i do that, it adds data at this datatable everytime it cannot match it.
Then it will send mail for every row.