Filter two datatable based on two column

A few options

  • Join DataTable - Left Join and react on the non founds
    Or
    LINQ as below

assign Activity:
dt3 =

(From d in dt1.AsEnumerable
Let c1 = d("Name").toString.Trim
Let c2 = d("Age").toString.Trim
Let arrC = new String(){c1,c2}
Let chk = dt2.asEnumerable.Any(Function (d2) {"Name","Age"}.Select(Function (x) d2(x).ToString.Trim).SequenceEqual(arrC))
Where Not chk
Select r =d).CopyToDataTable

Alternate (2 cols check without SequenceEqual Approach):

(From d In dt1.AsEnumerable
Let c1 = d("Name").toString.Trim
Let c2 = d("Age").toString.Trim
Let chk = dt2.asEnumerable.Any(Function (d2) d2("Name").ToString.Trim.Equals(c1) And d("Age").ToString.Trim.Equals(c2))
Where Not chk
Select r =d).CopyToDataTable

Handling empty rows:
:ambulance: :sos: [FirstAid] Handling of The source contains no DataRows exception - News / Tutorials - UiPath Community Forum

Also have a look at the Set operations Intersect, Except from LINQ