I need to compare 2 excel file. E.g -employee details, Manager Details… have to look for the manager code in employee details file and get the respective mail id of the same (Manager code will be available under employee code in employee details file) and store in seperate file…
Hi @srivid_it , Welcome to UiPath Forum.
please can you show me the same column which should available in both the tables.
pls follow the steps:-
- Excel application scope
- Inside excel application scope take 2 read range activities. 1 read range for Employee Details(variable DT1) next one for Manager Details(variable DT2)
→ build DataTable activity here build a table which you want as a output columns.(Manager code) in properties output create one variable (DT3) - Take ForEach in DataTable
- Inside ForEach read the first table Employee Details (DT1)
- Choose the column which is match with the another table column.
CurrentRow("ColumnName").ToString
- and take another ForEach in DataTable to read Managr Details (DT2)
- Select the column in Manager Details matched with the Employee Details table column.
CurrentRow2("ColumnName2").ToString
- Take If condition
CurrentRow(“ColumnName”)=CurrentRow2(“ColumnName”)
Then
assign->managercode=CurrentRow(“ManagerCode”)```
-
Add data row in properties in array {ManagerCode} in properties DT table mention (DT3)
-
ExcelApplicationScope
-
Write range
file path: YOUR EXCEL FILE PATH(OUTPUT)
DataTable:DT3
I hope this will work. if need any asistance please let me know
Thanks&Regards
NaNi
Hi @srivid_it
you can try linq query for this around
- Assuming that employee details : dt1
Manager Details : dt2
use the linq query
array_data= (From r1 in dt1.AsEnumerable
From r2 in dt2.AsEnumerable
Where r1(“manager code”).ToString.Equals(r2(“manager code”).ToString)
Select r(“mail id”).ToString).ToArray()
Try this way
Regards,
Nived N
Hi Thirunani
Thank you…it works.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.