Skip to main content

Hierarchy filter

Filter data using a hierarchy tree structure. Display departments, metadata, and dynamic data in an organized, easy-to-navigate format.

What is the Hierarchy Filter?

The Hierarchy Filter is a dynamic filtering control designed for handling hierarchical data with clear parent-child relationships. By linking parent and child fields, it presents data in a multi-level structure, enabling users to progressively select the required items. This control greatly improves efficiency and user experience in multi-layered data scenarios.


Use Cases for Hierarchy Filter

  1. Organizational Structure Filtering: Select levels like company, department, team, or individuals.

  2. Catalog Filtering: Filter product categories, subcategories, and specific models.

  3. Geographical Selection: Multi-level selection for country, province, and city.

  4. Task Management: Choose levels from projects to sub-tasks to assignees.

  5. Workflow Categorization: Filter processes and sub-processes.

In Yeeflow, the Hierarchy Filter Control can be used in approval forms, list forms, and dashboards.


How to Use the Hierarchy Filter?

In the form designer, click the + button, navigate to Data Filters > Hierarchy Filter, then drag and drop the control onto the canvas.


To filter a Data Table with this control, open the table’s Data Filters condition. Choose the field and comparison for the records you want to show. Switch the condition value to dynamic mode, open the Expression Editor, and insert the same variable under Filter variables. Match the condition to the value the filter returns. Use filter variables in a Data Table

1. Basic

  • Title: Set the title to describe the purpose of the control, e.g., “Organization Selection.”

  • Filter Variable. Use the associated variable created with the filter, such as filter_hierarchy. Use Edit to rename it or Reset to bind an existing variable. Reference this variable in the target control’s condition.

  • Apply Type. Choose Value change to update the filter variable as the selection changes. Choose Click on apply button to update it when the user selects the linked Apply Button. Add the button to the page and select it in the filter’s settings.

    For more details on Apply types, refer to: Understanding Apply type in Yeeflow Data Filter Controls

The Basic settings show filter_hierarchy and the two apply modes, Value change and Click on apply button.

2. Choice Options

The Hierarchy Filter Control supports three data sources: Department, Metadata, and Dynamic.

Each has distinct configuration steps and use cases:

2.1 Source: Department

Ideal for data filtering based on organizational structures like company, department, or team.

Department Choice options with Multiple selection and Hierarchy enabled and the Default, Linked selection, and Independent selection menu open.

  • Parent Node:

    • Static: Manually input the parent node as the starting point (e.g., “Product Team”).

    • Variable: Dynamically filter the parent node using conditions or rules.

  • Maximum items. Set the limit for the options and verify the number shown in preview. If you enable Multiple selection, use the separate Maximum selection setting to control how many nodes a user can select.

  • Multiple Selection: Toggle whether users can select multiple options.

  • Hierarchy: Enable multi-level display.

    Hierarchy: You can enable/disable hierarchy for this field. By default, it's disabled for Department fields.

    • A enabled hierarchy is a way to offer this field with all departments and their subordinates in your Yeeflow or your custom parent node.

    • A disabled hierarchy will offer the sub-departments under your Yeeflow or subordinates under its parent node.

    Hierarchical Selection Mode

    Under Choice options, choose Department and turn on Multiple selection and Hierarchy. Then use Hierarchical Selection Mode to control which department values the filter returns.

    1. Default

      • This is the standard behavior (same as Linked selection).

    2. Linked selection

      • When you select a parent or all its children, the selection reports the parent. The tree can show check marks for the linked branch. Check the value returned to the target condition when the exact department matters.

    3. Independent selection

      • Selecting a parent will only select the parent itself.

      • You can also select all children individually. If both the parent and all children are selected, the final result will include the parent and all of its child departments.

  • Collapse: Allow users to expand or collapse levels.

  • Collapsed by Default: Set all levels to collapse upon initial load.

Use Cases:

  • Department filtering in approval workflows.

  • Organizational structure management.

2.2 Source: Metadata

Metadata is used for standardized classification data such as leave types, product categories, and regions. These need to be predefined in the system.

Steps to Predefine Metadata:

  • Path: Admin Center > Data management > Metadata.

  • Create new metadata categories and maintain data items.

    • Add a category. In the metadata category list, select + New Metadata and enter the category code and name. Open the category and select + New item to add an entry. Metadata management

    • Add a child item. Open an existing item’s menu and choose Add sub item.

Key Configuration:

  • Scope:

    • Current Application: Limit metadata to the current app.

    • Global Metadata: Use metadata shared across other applications.

  • Metadata Category: Select from predefined categories, e.g., "Document type"

  • Parent Node:

    • Static: Manually set the starting point.

    • Variable: Dynamically filter the parent node.

Use Cases:

  • Filter data based on standardized classifications.

  • Unified data management across multiple business scenarios.

2.3 Source: Dynamic

Dynamic sources load business data in real-time from applications and data lists.

Dynamic source mappings: Name is the display field and child key, and Affiliated organizations is the value field and parent reference.

  • Application: Select the application that contains the target data source.

  • Data Source: Choose a specific data list, form report, document library, or data report within the application.

  • Data Filters: Set filtering conditions to ensure the loaded data complies with business rules.

  • Primary and Secondary Sorting:

    • Primary Sorting determines the main sorting rule for the data.

    • Secondary Sorting further refines the order of items at the same level based on the primary sorting.

  • Display Field: Specifies the content displayed to users in the control, usually a field from the data table. The control uses this field to load the current level's node names.

  • Value field. Choose the value the filter returns for the selected node. Use a field compatible with the comparison in your target control. In the example image, the value is Affiliated organizations and the display label is Name.

  • Relation field (Parent). Choose the field that identifies each record’s parent. For example, a category’s parent code should match the category code on its parent record.

  • Relation field (Child). Choose the field that identifies the current node, such as its category code. Use the same kind of value that other records use in their parent field.

  • Hierarchy Settings: Supports configuring the maximum number of selectable items, enabling multi-selection, and turning on hierarchical display.

Use Cases:

  • Real-time filtering of project tasks, workflow nodes, etc.

  • Choose source filters to limit the nodes offered in the tree. Preview with a typical reader account to check the choices and visible records.


3. Appearance

  • Search Enabled: Allows users to search for specific items (default: off).

  • Dropdown Enabled: Displays the hierarchical data in a dropdown format (default: off).

  • Display Title: Toggles whether the title appears above the control (default: on).

  • Title Layout: Position the title.

  • Vertical Align: Align title vertically (options: Default, Top, Center, Bottom).

  • Title Width: Adjust the width of the title.

  • Dynamic Display Rules: Set conditional rules to show/hide the control based on other fields or values.


4. Validation

  • Read-Only: Makes the control display-only.

  • Custom Validation: Configure rules and error messages to validate user input.


5. Actions

  • Value Change: Click on the dropdown to set actions triggered when the value changes, such as refreshing forms or loading related control data.


Key Considerations

  1. Data Integrity: Ensure the data table has clear parent-child relationships.

  2. Field Selection: Correctly configure display, value, and relationship fields.

  3. User Experience: Optimize sorting, hierarchy expansion, and search settings for better usability.

In preview, expand a root node and two levels of children. Select a node with matching records and one without. If you use Click on apply button, check the table before and after clicking. If selecting a parent should show its descendants’ records, check the target condition and selection mode against that expected result.

Did this answer your question?