Using IF Statement to Cross-Reference

In my process, I am opening a webpage that has an “EmployeeID” on it and I am trying to set up an if statement stating if that EmployeeID = EmployeeID from the excel sheet, then keep running the process. Any suggestions?

1 Like

@sam1313

  1. First use Read Range activity to read data from Excel and will give you output as Datatable.

  2. Then use For Each Row activity to iterate that Datatable.

    ForEach row in varDT 
        IF row("EmployeeID").ToString = varEmployeeID
            Then continue 
             Else stop
    

Note: To read Employee ID from web page use Get Text activity and store it in a string variable and say ‘varEmployeeID’.

1 Like

Fine
hope these steps could help you resolve this
–use excel application scope activity and pass the file path as input
–inside this scope use a read range activity and get the output with a variable of type datatable named outdt
–now use a for each row loop and pass the above variable as input
–inside the loop use open browser activity and mention the URL we want to navigate
–once after getting to the page we can use an activity to get the employee id
using get text activity or screen scrapping option from design tab in studio with which we can get the text we want as a string variable and name that variable like out_text
–then use a if condition like this
row(“yourcolumnname”).ToString.Trim.Equals(“out_text.ToString.Trim”)
if true it will go to THEN part of if condition where we can go forward with our process
or it will go to ELSE part where we can leave it empty or use activities to be used if the employeeid is not equal

simple isnt it
hope ths would help you
Kindly try this and let know for any queries or clarification

Cheers @sam1313