Can't access ExportedString Out Argument in Export UI Tree activity

The activity says that if you omit the Export Path, the UI Tree will be exported to the ExportedString Out Argument. However, this doesn’t seem to be accessible in any way. Another user suggested I enter a bug report:

https://forum.uipath.com/t/how-to-use-export-ui-tree-activity-to-output-to-a-variable/504345/2

This is a weird activity because for some reason they have set the ExportedString OutArgument to have the [Browsable(false)] tag. This stops the property from being displayed in the Properties window and since its not made available via the activity card its basically made very difficult to access.

Should you need to do it then you can by directly editing the xaml the activity is in.
For example if you have the following xaml code for the activity.

    <ui:ExportUiTree DestinationFile="{x:Null}" ExportedString="{x:Null}" Filter="{x:Null}" OperationTimeoutMS="{x:Null}" DisplayName="Export UI Tree 'LI'" Format="XML" sap:VirtualizedContainerService.HintSize="338,245" sap2010:WorkflowViewState.IdRef="ExportUiTree_1" IncludeScreenshots="False" Overwrite="False" Priority="Performance" UiFramework="Default">	  
      <ui:ExportUiTree.Target>
        <ui:Target ClippingRegion="{x:Null}" Element="{x:Null}" Id="88dd9e49-fb27-4ae0-b85b-8bda3ab90d7d" InformativeScreenshot="db971900a9e0541a53e26f2e436d5a94" Selector="&lt;html app='chrome.exe' title='LIVE | Home' /&gt;&lt;webctrl css-selector='body&amp;gt;table&amp;gt;tbody&amp;gt;tr&amp;gt;td&amp;gt;table&amp;gt;tbody&amp;gt;tr&amp;gt;td&amp;gt;div&amp;gt;ul&amp;gt;li' idx='3' tag='LI' /&gt;">
          <ui:Target.TimeoutMS>
            <InArgument x:TypeArguments="x:Int32" />
          </ui:Target.TimeoutMS>
          <ui:Target.WaitForReady>
            <InArgument x:TypeArguments="ui:WaitForReady" />
          </ui:Target.WaitForReady>
        </ui:Target>
      </ui:ExportUiTree.Target>
    </ui:ExportUiTree>

You can see here the ExportedString property is available and set as null. You can edit it and set it to this.

<ui:ExportUiTree DestinationFile="{x:Null}" Filter="{x:Null}" OperationTimeoutMS="{x:Null}" DisplayName="Export UI Tree 'LI'" Format="XML" sap:VirtualizedContainerService.HintSize="338,245" sap2010:WorkflowViewState.IdRef="ExportUiTree_1" IncludeScreenshots="False" Overwrite="False" Priority="Performance" UiFramework="Default">
      <ui:ExportUiTree.ExportedString>
        <OutArgument x:TypeArguments="x:String">
          <mca:CSharpReference x:TypeArguments="x:String" sap2010:WorkflowViewState.IdRef="CSharpReference`1_1">test</mca:CSharpReference>
        </OutArgument>
      </ui:ExportUiTree.ExportedString>
      <ui:ExportUiTree.Target>
        <ui:Target ClippingRegion="{x:Null}" Element="{x:Null}" Id="88dd9e49-fb27-4ae0-b85b-8bda3ab90d7d" InformativeScreenshot="db971900a9e0541a53e26f2e436d5a94" Selector="&lt;html app='chrome.exe' title='LIVE | Home' /&gt;&lt;webctrl css-selector='body&amp;gt;table&amp;gt;tbody&amp;gt;tr&amp;gt;td&amp;gt;table&amp;gt;tbody&amp;gt;tr&amp;gt;td&amp;gt;div&amp;gt;ul&amp;gt;li' idx='3' tag='LI' /&gt;">
          <ui:Target.TimeoutMS>
            <InArgument x:TypeArguments="x:Int32" />
          </ui:Target.TimeoutMS>
          <ui:Target.WaitForReady>
            <InArgument x:TypeArguments="ui:WaitForReady" />
          </ui:Target.WaitForReady>
        </ui:Target>
      </ui:ExportUiTree.Target>
    </ui:ExportUiTree>

In this one you’ll see the ExportedString attribute is removed and a new node is added to specify that it is outputted to a variable called ‘test’. (Please note this is using a C# project, it should still work as is in a VB.Net project but you can also adjust the node to use the VB syntax.

This now works when you run the workflow to output the value.
I really have no clue why browsable was set to false. Seems like a bug with a very simple fix.

1 Like

Most excellent! Thank you. It never occurred to me to look at the activity’s code.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.