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
Organizational Structure Filtering: Select levels like company, department, team, or individuals.
Catalog Filtering: Filter product categories, subcategories, and specific models.
Geographical Selection: Multi-level selection for country, province, and city.
Task Management: Choose levels from projects to sub-tasks to assignees.
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.
Below are the detailed settings:
1. Basic
Title: Set the title to describe the purpose of the control, e.g., “Organization Selection.”
Filter Variable: Choose or input a variable name to store the selected value, e.g., filter_hierarchy.
Apply Type: Configure the trigger action type when users operate the control. Options include "Value change" and "Click on apply button" (commonly Value Change).
For more details on Apply types, refer to: Understanding Apply type in Yeeflow Data Filter Controls
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.
Parent Node:
Maximum Items: Limit the number of selectable items (default: 20).
Multiple Selection: Toggle whether users can select multiple options.
Hierarchy: Enable multi-level display.
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 Category: Click “+ New Item” and input a category name, e.g., “Document type.”
Sub Item: Clicking the three dots to 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.
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: Defines the actual value stored when a user selects a node. This is typically the unique identifier for each node, used for subsequent data processing or interactions.
Relation Field (Parent): Identifies the relationship to the parent node. The control uses this field to locate and load each node’s parent, dynamically generating the hierarchical tree structure.
Relation Field (Child): Specifies each node’s own value and links it to the parent field. Through recursive queries on the child field, the control dynamically loads all direct child nodes under each parent node, enabling step-by-step expansion of the hierarchy.
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.
Permission-based dynamic data loading.
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
Data Integrity: Ensure the data table has clear parent-child relationships.
Field Selection: Correctly configure display, value, and relationship fields.
User Experience: Optimize sorting, hierarchy expansion, and search settings for better usability.
By following these configurations, the Hierarchy Filter Control can efficiently handle complex multi-level data filtering needs, improving user interaction accuracy and efficiency.