Tree Tool

Tree Tool

Version:
Current
Last modified: October 29, 2019

The Tree tool displays an organized, hierarchical data structure in an app or macro. The selections made by the user are passed as values to downstream tools. The values returned from trees are separated by a new line character (\n).  

This tool has an optional input connector White "Q" icon that can accept a list of Allocate datasets. See the Allocate Tree Data Sources below for more information.

Tool configuration

Configure the tool

  1. Enter the text or question to be displayed: The text presented to the app user defining how to use the Tree control.
  2. Tree Data Source: Location from which the hierarchy is pulled. Configuration options are under Properties.
  3. Single Selection: When checked, the App user can only select one tree value.
  4. Tree Window Height (Lines): Set the number of lines to display at once to a user. If more options are available, a scroll slider appears.
  5. Limit Tree Selection: Select to access the Filter Options window, which displays the entire available tree. Select the tree elements to display to the App user.
    • To include all child options, select the parent element.
    • To use this option with Allocate trees, select "Use a specific Dataset".
      Set which parent levels of the tree to display:
      • Automatically decide which parent levels to display: The highest of the selected levels of the tree are displayed. When all children values of a parent are selected, the parent is displayed.
      • Show all parent levels of the tree: All parent levels of the selected tree are displayed.
  6. Properties: Values change depending on the selected Tree Data Source. Select the related data source for more information.

Allocate Geography

Configure the list of Allocate Geographies displayed to the App user.

Select what dataset is displayed:

  • Take Dataset from Allocate Dataset List: Displays all datasets installed on the App Consumer's machine for selection.
  • Use a Specific Dataset: Displays only the specified dataset. The App Consumer must have the dataset specified in order to choose an Allocate Geography.

Select how values are saved:

  • Save Values as XML: Values will be returned in XML format and must be updated via an Update XML action.
  • Save Values as Allocate Workspace Snippet: Values will be returned as an Allocate Workspace Snippet and will need to be updated accordingly through a valid action.

To display a drop down list of available Allocate datasets to the user, connect a Drop Down Tool to the input connector White "Q" icon of the Tree tool, and set List Values to 'Allocate Datasets'.

Allocate Variables

Configure the list of Allocate Variables displayed to the App user.

Select what dataset is displayed:

  • Take Dataset from Allocate Dataset List: Displays all datasets installed on the App Consumer's machine for selection.
  • Use a Specific Dataset: Displays only the specified dataset. The App Consumer must have the dataset specified in order to choose an Allocate Geography.

Select how values are saved:

  • Save Values as XML: Values will be returned in XML format and must be updated via an Update XML action.
  • Save Values as Allocate Workspace Snippet: Values will be returned as an Allocate Workspace Snippet and will need to be updated accordingly through a valid action.

To display a drop down list of available Allocate datasets to the user, connect a Drop Down Tool to the input connector  of the Tree tool, and set List Values to 'Allocate Datasets'.

Show Field Names: Tree elements display field names.

File System Directory

Configure the list of a system directory's files displayed to the App user. This control returns files. Directories are not selectable. Empty directories are not displayed.

  1. Root Path: Browse to the directory.
  2. Wild Card: Set a wild card to limit file display.

*.yxdb displays all .yxdb files found in the specified Root Path.

Custom XML

Configure the custom list of options from an .xml file displayed to the App user.

Custom XML Path: Browse to the .xml file. The path must be updated if the .xml file is moved.

xml
  1. <AlteryxTree>
  2.  
  3. 	<!-- Parent name is Crops -->
  4. 	<v n="Crops" k="01">
  5.  
  6. 		<!-- The displayed child name is "Wheat" -->
  7. 		<v n="Wheat" k="0111">
  8. 		</v>
  9.  
  10. 		<!-- The returned value is "0112" -->
  11. 		<v n="Rice" k="0112">
  12. 		</v>
  13.  
  14. 		<!-- This child is not selectable and displays a red X -->
  15. 		<v n="Corn" k="0115" l="F">
  16. 		</v>
  17.  
  18. 		<!-- This child is not selectable and displays a grey X -->
  19. 		<v n="Soybeans" x="0116">
  20. 		</v>
  21. 	</v>
  22. </AlteryxTree>

v: Element. Required.

n: Name that will be displayed. Required.

k: Value of the element. Required if the node is selectable.

l: Set to "F" to make element unselectable with a red X.

Any value assignment other than k or l will disable the selection with a grey X.

Values are returned separated by a new line.

Custom File/Database

Configure the list from a custom file or database displayed to the App user.

File/Database Path/Connection: Browse to the database file. All known file types are supported. The path must be updated if the database file is moved.

Key Field: Select the Key field for the database. The Key field must be unique per record. The hierarchy is established based on the value of the Key field.

Description Field: Select the Description field for the database. The Description is displayed as the element name to the App user.

Formatting Custom Files

The following file format creates a tree structure for Country > State > County > City. The Key has two digits for each level, stacked in sequence and increasing incrementally for each option. The value resets for each new branch.

Record number Key Description
1 01 USA
2 0101     Colorado
3 010101 Boulder
4 01010101 Louisville
5 01010102 Superior
6 01010103 Boulder
7 01010104 Gunbarrel
8 0102 California
9 010201 Orange County
10 01020101 Irvine
11 01020102 Anahiem
12 01020103 Buena Park
Was This Helpful?

Need something else? Visit the Alteryx Community or contact support.