Search for value

Hi Team,

I have two excel both of them has the same column the “EMP_NO” and i have created for each activity to get every Employee number and to look for it in the other range if it there or not then to get back and write in the same row that he found the value (employee number) or didn’t
so how can i do this?

@omar_ismail

as you are using for each activity to get employee number use the below query

in if activity and pass the condition

dt2.AsEnumerable.any(Function(r) r(“ColumnName”).ToString.trim.Equals(“YourValetoSearch”)

gives boolean value

inside if use assign activity

Rowindex=dt2.AsEnumerable.ToList.FindIndex(Function(r) r(“ColumnName”).tostring.trim.equals(“yourvalue”))

rowindex is the index of the matched row

what will happen late please clarify more if you can

@omar_ismail

can you explain after finding the value which is there in 2nd excel

or
can you share any sample input and expected output

In general it is a match case and we can implement with

  • DataTable Lookup
  • using a LookUp dictionary
  • Join DataTable
  • LINQ

A hybride (essential / LINQ) modelling could look like this

  • For each row ind DataTable Activity | row in Your DataTable

    • IF Activity| Condition:
    dt2.AsEnumerable().Any(Function (x) x("EMP_NO").toString.Trim.Equals(row("EMP_NO").toString.Trim))
    
    • Then: Assign Activity row(StatusColName) = “Found”
    • Else: Assign Activity row(StatusColName) = “Not_Found”

Feel free to edit the status info as needed