Bind Data to Tree Element

The Tree element cannot be used as a custom list, so it is bound to a data table. Follow the steps below for data linking:

1. Create Datasource

  1. Enter the Datasource module.
  2. Create a new table and define the following columns:
    • ID (Guid): Unique ID of the data
    • Title (String): Title of the item to be displayed
    • ParentID (Guid): ID of the parent to which the data is bound (use null for parent items)

2. Create SQL Action

  1. Go to the Actions module.
  2. Click on the+ icon and select New SQL Action.
  3. Enter the following SQL command:
SELECT * FROM your_datasource_name

     4. Create the SQL Action by clicking the CREATE button.

3. Binding Data to a Tree Element

  1. Select the Tree element.
  1. Go to Options in the Properties panel on the right side.
  2. Click on the Actions field and select the SQL Action you created.
  3. Configure the following fields:
    • Field to Display ID: Select the database column where the data will be displayed (for example, Title).
    • Field to Use as Key: The column to use as the unique key for the data (usually ID is selected).
    • Field to Use as Parent: Column that determines which parent the child items belong to (ParentID). If the data will be located at the top level, the value of this field should be returned as null.