Comparison of rows between two datatable

I have to compare select columns(Vendor, City, Country) of DT1 with DT2 (which has complete vendor details) . How to do such a comparison?

Thanks
Balaji

@mailtobalajiv

Welcome to the UIPath Community.

use nested For Each Row activity and then use IF condition to compare the values.

                           ForEach row in DT1
                                ForEach row1 in DT2
                                   if row("Vendor").Tostring.Equals(row1("Vendor").Tostring) .....
1 Like

What sort of result do you want? @lakshman is a good way to be able to action each row if they match. If you want say just the unique the rows you could merge the tables and then remove the duplicate rows, leaving just the rows that were unique in each table.

1 Like

This is my assignment
1.Scrap all vendor details.
2. For every row in vendor details retrieve Tax id
3. Search specific vendor by passing the Tax id (from step2).
4,Extract Vendor, city and country from the specific search ; compare it against vendor details (scrapped in step1).
5. if the country is france; store it in excel sheet.

What should i do if i have multiple columns to verify?
should i put one another nested if?

@mailtobalajiv

No. Try this

IF row(“Vendor”).Tostring.Equals(row1(“Vendor”).Tostring) AND row(“City”).Tostring.Equals(row1(“City”).Tostring) AND row(“Country”).Tostring.Equals(row1(“Country”).Tostring)