Showing results for 
Search instead for 
Did you mean: 
New Member

Dynamic UI Element (Use variable) Desktop

Ok short but sweet. how the heck do you use a variable in the selector builder?, it seems not to parse it and is unable to find window.  To replicate


-Create a desktop flow

-Open a blank Excel doc

-Capture something from toolbar and click it

-Try running - runs fine

-create a variable with your workbook name (Book1)

-Now alter the UI element to use name and process

-Alter name to be contains with the value as your variable i.e. %MyWorkBookName%

-the connector should look like this:

:desktop > window[Name*="%ExcelWorkBookName%"][Process="EXCEL"]

-Now save it

-Try running - watch in amazement as it cant find the window


Any help appreciated!The story is I have many excel docs which have repeatable actions - i want 1 subflow per action that i can just pass workbook name to...


That siad i would love to call a different flow (not sub flow) although seems not possible in desktop, and even if it was the above issue still makes it impossible to have a modular approach!


New Member

I have the same question. 

Super User
Super User

Hi @tweeter103 


Using variables in the selector works perfectly fine.

Please make sure you are using the "Custom" toggle button.


Also check this link



I am passing XYZ.xlsx to the MyWBName variable



New Member


Thank you and sorry for slow response.

You are indeed quite correct, and it is straightforward.

My problem was I had the "" and %% inside out.

"%VariableName%" works correctly

Thanks again.


Helper II
Helper II

I'm using variable to Attribute value. However, in text editor / preview Selector, the attribute name 'Ordinal" is not populating : 



The flow is not using the dynamic value from the variable. Do we have any other reason here?



Helpful resources

Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,155)