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:

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.