Help building robot to click specifici depending IF a project no. begins with the first few specific characters

Goal: Robot shall read project numbers from an excel sheet, and based on the unique designation of each project number, click a specific tab in a web page.

Materials I have: 1 excel sheet containing 1 column header “project no.” and 8 rows, each containing 8 types of project numbers e.g.

Project no [header]

ABC123
DEF123
HIJ456
LMN123
OPQ123
RST123
UVW123
XYZ123

Example. For project ABC123, robot must click a specific tab in a browser.

Limitations: I do not have EXCEL read range on this version of uipath. I can only use workbook read range.

I have started by having a Workbook Read Range activity.

Not sure how to proceed. Somehow i know there must be an IF/then activity. I must somehow create a VARIABLE for each project no. from the excel sheet. Using this variable, I will then use the If/then activity. But I do not know how :frowning:

you dont need 1 variable for each project#

use read range to read excel to dt (Datatable)
then use foreach row activity
in the foreach row activity, add switch statement, and drop the corresponding click activity under each project#

Thanks for the fast reply I will try it today. Hopefully my version of uipath has this “switch case” activity… if it doesn’t I might be in deep yogurt.

Does this solution work if I want to apply it for hundreds of other projects each with their own project number? Albeit out of these many projects, there will be 8 types (based on the first few letters) that will need the robot to click different tabs.

Seems counter intuitive that variables need not be created?

Will try your method. Tks

=

how many letters? and is it the same for all project numbers?

the switch statement should change to this to only handle first N letters

e.g. if first 5 letters, then

assign Left(currentRow("ProjectNumber").toString, 5)
to firstNLetters variable (string)

then use switch on firstNLetters variable
image