How to use a variable in: <webctrl aaname=VARIABLE />

Hey thanks for quick response…
But I didnt get that properly …

Suppose I am having array of string var1= {“a”,“b”,“c”}… and my dropdown consists of
a
b
c
I edited the selector property and assigned that value to another variable.

ie; var2= <webctrl aaname=’"+var1+"’ parentid=‘searchForm’ tag=‘A’"/>

I have to first click a, then b and finally c.
Inside click selector property, I tried calling the variable var2

No validation errors…But still no luck with click activity !!!

Hello @UnicornStark
your code should be like this:
For each item in var1
Click acitivity-Selector: “<webctrl aaname=’” + item.tostring + “’ parentid=‘searchForm’ tag=‘A’”/>"
if needed give delay

1 Like

Hi I am a real newbie but trying-- I want variable for idx=1 I want idx=intcounter ( intcounter is a variable type int)
I understand I have to use expression editor instead of selector editor.
You state manually drag object from list on left do u mean activity from activity list in my case it is “click” clicking on properties brings upexpression editor as u state.
Next u state "What I now do is use “record” to stage my process, then delete the object on which I want to use the Expression Editor and then manually added it back. " This is not clear to could u pls explain!!
Thanx

Hi @amithvs ,
when we add a variable in selector using the Selector editor as shown in the picture


will be changed to

So

4 Likes

Hi All,

I have similar problem. I have read through all the responses above and am sure I am missing on something.
I am trying to select a date in the google calendar and instead of taking that exact date I am using a variable instead. For now, I am using that variable with a fixed value.

I am not able to use that variable in the selector

Below is the screenshot of my selector

Can someone suggest whats the problem here?

Hi @anshulagarwal,

Copy the below selector and paste in the selector properties

"<html app='Chrome.exe' title='Google Calendar-*' /><webctrl aaname='"+num.ToString()+"' parentid='drawerMiniMonthNavigator' tag='DIV' />"

Refer the Previous post

Regards,
Arivu

1 Like

I found this useful… But I was wondering why is this happening in the first place?
UiPath is automatically converting – " – into – &quot + ; –
PS: I have added + else it would become "

@SUBHAM_KUMAR,Don’t edit the selector directly,Edit the selector in the properties panel

Thanks @sreekanth
I am using it in the same way… I was curious why is this happening?

It’s because the Selector editor is not a string. You can only concatenate variables into strings. Once you edit the string in the properties pane though it will open the Expression editor which is a string; that will make it easier to edit.

3 Likes

@ClaytonM Now I got… Many Thanks :slight_smile:

Hi all,
To pass your variables or arguments to selector, DO NOT CLICK the “…” box to open the Selector Editor window. The Selector Editor window does not recognize your variables or arguments.

You need to edit the selector directly to the selector field in the property pane (Which is a Expression Editor). Try to Type the the step as follows:

  1. "
  2. SpaceBar
  3. “+”
  4. your variable or argument ( the drop down box will appear showing that the program is now recognize your V and A)

PS. After you edit selector in the field in the property pane and you click the “…” box again, the pop up window will become “Expression Editor” instead of “Selector Editor”

Hope this is helpful.

17 Likes

Thank you bro. It worked. Is it documented somewhere. Could you please suggest.

I want to scrape data from google according to the search the user makes, that is the scraping topic will vary. how to edit the selector? how can i do this type of scraping?

for example,
i have automated the data scraping by searching a manufacturer name (for example ABB) but i want to make the automation as such that the program will extract data even if i change the name (for example anything other than ABB).

can you elaborate what type of search criteria would change because this completely depends on the structure of the result you get. if the result structure would be same always try WildCards in selectors. See this

Hi ,
I have requirement i need to pass variable into selector where my tableRow starts from 2,
Please find the screenshot of the selector,where iam using tableRow=’"+pRowCounter.ToString+"'

and iam not getting how to give pRowCounter, if i use assign activity what should be the value!, where the value of tableRow increments in foreach loop

1 Like

i want to really really thank you , i expend like 2 hours trying to see why i was not working :smiley: thanks!

Yeah, that works for me. Thanks !!!

Hi everyone,

You can now define your variables for selectors directly in Studio.

Please check our official documentation here:

As well as this short tutorial on our Forum:

I took the liberty to change the solution flag to this post to let our users know about this feature :slight_smile:
Old solution post is this one.

1 Like