Configuring Selector with info from Read Csv

I have a web pop up as part of aprocess and wanting to click on the text based on info in CSV file
I have read CSV in Flowchart and For each Row in Sequence.

I’m stuck on it selecting the correct text using CLICK TEXT Activity

Ive changed the selector in UI explore so its has aaname=

<html app='chrome.exe' htmlwindowname='selectDepts' title='Select Departments' />
<webctrl aaname='600 Contract Fabrication (600 CONTRACT FABRICATION)' />

Instead of 600 Contract Fabrication… I want it to use the CSV info in column named “Department”

I tried this but get Error

Thanks

Hi @KarenL

The correct syntax to get the column item from a specific row would be:
row.Item("columnName").ToString

This assumes that this code is placed within the For Each Row activity.

Thanks that made the ! go away :slight_smile: … I’m now getting “Selector not valid” when using the below

“<webctrl aaname=”+row.Item(“Department”).ToString+" />"

I must be missing something

The syntax is correct. Could you post the exception error message?

image

I think I have just had this issue. Could you make sure to retype all the quotation marks and apostrophes instead of pasting them into the selector window?

Thanks for your help… just retyped and rerun… same error ;-(

I think I need to walk away and look at it it fresh eyes tomorrow

The easiest way would be to first try if it still works without using the variable. I would try to fix it as follows:

  • Indicate on Screen again for your Click activity
  • test if it works
  • without opening the Selector Editor, copy the selector string directly from the Selector field
  • paste it into notepad
  • prepare your entire variable string
    " + row.Item("Department").ToString + "
  • simply paste it into the selector that is in notepad on top of the value that is there
  • copy and paste this modified selector to the Selector field in UiPath
  • give it a go

Thank you thank you … it now works
I re-recorded it and it added activity as just CLICK (not click text)
Then I did what you said and ended up with
image

If I want a wildcard at the end … as the CSV will only have for example
600 Contract Fabrication

and the Web page shows
600 Contract Fabrication (600 CONTRACT FABRICATION)

will this work?
…ToString+“*’ />”

Yes, it should work with the wildcard :slight_smile: