web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Expand Tree on Desktop...
Power Automate
Unanswered

Expand Tree on Desktop Flow does not find node with variable

(0) ShareShare
ReportReport
Posted on by 2

Hi everyone,

I am struggling with this task:

 

In my window there a two tree view root nodes. Both have the same child node names in the next level. Thus I need to be able to address the first children in respect to the name of the root level name.

I have added the UI-element and now can change what its name should be. But as soon as I am using a name given by variable the node is not found anymore:

ThoRad_0-1696597271627.png

I have an input variable, which is %SSV%. In my flow I set the value to it to e.g. "D" and configure the element is to be found via option "contains", which definitely is part of the name. This does not work.

The error message always says "tree node ''" not found. Even when I've set the name to a constant string value. (see below)

I am sure that I have addressed the correct UI-element by renaming the respective element to "foobar" which then shows up in my flow. Also I could verify that I am addressing a working UI element by setting the value to a constant string which can be found in the name of the element.

As my last resort I tried to switch every possible option from Id or guid to name, which would still be okay, since every container is show only once, but still without success. I can show the value of my variable in a message and can clearly see that it has the value I can also see on my "variables" pane - without any change of the outcome.

 

In another step I am addressing a specific tree view item by name which is also a variable - works without any issues. But I can only address this node when I was able to expand the parent node 😕.

 

Korrelations-ID: 97de8f07-fe46-44ee-88a8-01808e21213e

Tree node '' not found: Microsoft.PowerPlatform.PowerAutomate.Desktop.Actions.SDK.ActionException: Erweitern des Strukturknotens fehlgeschlagen (Strukturknoten wurde nicht gefunden) ---> Microsoft.Flow.RPA.Desktop.UIAutomation.DesktopCore.Exceptions.TreeNodeNotFoundException: Tree node '' not found
bei Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.AutomationRuntimes.UIAutomationRuntimeBase.ExpandCollapseTreeNodeInWindow(IntPtr windowHandle, String selector, String nodePath, Boolean pathUsesRegex, Boolean expand)
bei Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.LocalAutomationRuntime.ExpandCollapseTreeNodeInWindow(UIRuntimeElement element, String folderPath, Boolean expandInsteadOfCollapse, Boolean folderPathUsesRegularExpressions)
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.UIAutomationRuntimeRouter.Invoke(MethodInfo targetMethod, Object[] args)
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei System.Reflection.DispatchProxyGenerator.Invoke(Object[] args)
--- Ende der Remoteausnahme-Stapelverfolgung----
bei Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.Proxy.RemoteAutomationRuntimeProxy.Invoke(MethodInfo targetMethod, Object[] args)
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei System.Reflection.DispatchProxyGenerator.Invoke(Object[] args)
bei Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.ExpandCollapseTreeNodeInWindow.<>c__DisplayClass13_0.<Execute>b__0(IAutomationRuntime r, UIRuntimeElement e)
bei Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Common.UIAutomationActionBase.PerformAutomation(Action`2 action, UIControl control, Boolean logAction)
bei Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.ExpandCollapseTreeNodeInWindow.Execute(ActionContext context)
--- Ende der internen Ausnahmestapelüberwachung ---
bei Microsoft.Flow.RPA.Desktop.Modules.UIAutomation.Actions.ExpandCollapseTreeNodeInWindow.Execute(ActionContext context)
bei Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

I've tried to use as few screenshots as possible due to the german localization.

I have the same question (0)
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    If you want to use a variable in the selector, you will need to enable the Text editor. It does not work in the visual editor.

    Try enabling this toggle, and then put in the variable:

    Agnius_0-1696599564525.png

     

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • ThoRad Profile Picture
    2 on at

    Hi Agnius and thank for your reply.

    I've tried that and found that using the {x} pastes the same content as I would write it in text editor. It does not change the outcome, the result is the same.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    The selector is the same, yes. But there is a common issue with PAD not working with variables when you provide them via the visual editor. They need to be passed in via the Text editor.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 233

#2
David_MA Profile Picture

David_MA 217 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 190

Last 30 days Overall leaderboard