> For the complete documentation index, see [llms.txt](https://muradkarakas.gitbook.io/sodium_documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://muradkarakas.gitbook.io/sodium_documentation/language-reference/built-in-functions/sodium-built-in-functions/other-functions/populate_tree.md).

# populate\_tree

`populate_tree` function has 1 variants:

{% tabs %}
{% tab title="Variant 1" %}

#### Declaration

```
void populate_tree(char treeName);
```

#### Description <a href="#description" id="description"></a>

1. `Needs` [`tree tag`](https://sodium.gitbook.io/sodium/language-reference/html-tags/sodium-tags/tree-element)`in`[`form file`](https://sodium.gitbook.io/sodium/language-reference/program-structure/form-file)​
2. `populate_tree` function initializes the tree element. After successful initializing, ["tree\_node\_expanded" Trigger](https://sodium.gitbook.io/sodium/language-reference/built-in-triggers/item-level-triggers/tree_node_expanded-trigger) will be fired.
3. `treeName` property is a string and should have match the following format: `block name + '.' + tree id`
4. &#x20;For detail on json data format: <https://www.jstree.com/docs/json/>​

#### Parameters <a href="#parameters" id="parameters"></a>

`char treeName`

#### Return Value <a href="#return-value" id="return-value"></a>

#### Example <a href="#example" id="example"></a>

Form file

```
<controlblock control-block-name="cbTree">
    <tree id="data"></tree>
</controlblock>
```

Sqlx file

```
void page.load() {
	 populate_tree('cbTree.data');
}
```

{% endtab %}
{% endtabs %}
