Loop through Excel sheet based priority of the condition

Hi everyone,
Need assistance in getting automate as I am a begginer.

I have 2 datables.DT 1 having all data and DT2 having the id column(by removing duplicates from dt1). I want take each row in DT2 and find in DT1(which is having duplicates).if it matches with 3 rows r 2 rows or 1row then I need to take based on status column as priority .

In DT2 ,id column details are 1,4,6. If it searches in DT1

Eg: id Status exception
1. Failed. BE
1. Failed. AE OUPUT : 1 Failed BE

Id status exception
4. Success. NA
4. Failed. AE
4. Failed. BE output : 4. Success. NA

Id. Status. Exception
6. Failed AE
6. Failed AE. Output : 6 Failed AE

Id status exception
5 failed BE. Output : 5 failed BE…

Need paste the output in different DT…


If i understood your requirement correctly, the following dt2 will be the right side table, right?


If it’s right, the following will work.

Sample20220325-2.zip (8.8 KB)


Thanks @Yoichi … Ur solution is really helpful.

1 Like

Can we do this using Uipath activities rather than. Linq query…