> 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/how-to/how-to-get-selected-tree-node-id.md).

# How to: get selected tree node id

## How to: get selected tree node id

&#x20;The only way to get selected node's id is to use ["tree\_node\_selected" Trigger](https://sodium.gitbook.io/sodium/language-reference/built-in-triggers/item-level-triggers/tree_node_selected-trigger).

```
void cb.data.tree_node_selected(char node_id, char parent_id) {
 
        :Global.selectedNodeId = node_id;
        :Global.selectedNodeParentId = parent_id;
 
        refresh_block('product_categories', 'id = ' || node_id);
}
```

​
