I am trying to use a variable inside a selector in UiPath, but the variable is not showing when I try to insert it from the Selector Editor. I have already created variables (e.g., pagelistnumberrr, selectorpage) in the Variables panel The variables are


Hi @krishna_Prasanna,

Maybe this issue is due to a bug in the newer Studio version.

As a workaround, you can pass variables directly in the selector using {{VariableName}}. Alternatively, select the value in the selector that you want to replace, right-click it, and choose the variable you want to use.

Thanks

@krishna_Prasanna

Try creating the variable from the selector panel.

Hi @krishna_Prasanna

It can sometimes be a bit finicky to make the Selector Editor accept variables being added to the selector.

As an alternative, you can edit the selector in the properties pane, with the Expression Editor afterwards.
Here you can use the String.Format to define your variables:

String.Format("<webctrl aria-label='{0}' tag='BUTTON' type='button' aaname='{1}' />",str_Variable1,str_Variable2)

Regards
Soren