# Dynamically populating Menu Tree from database table

**URL:** <https://forum.inductiveautomation.com/t/dynamically-populating-menu-tree-from-database-table/43573>\
**Category:** Ignition Early Access\
**Tags:** ignition80, database, scripting, perspective\
**Created:** [February 18, 2021, 4:23pm UTC](https://forum.inductiveautomation.com/t/dynamically-populating-menu-tree-from-database-table/43573 "2021-02-18T16:23:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter.Dmitriev](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@Peter.Dmitriev](https://forum.inductiveautomation.com/u/Peter.Dmitriev)\
**Post date:** [February 18, 2021, 4:23pm UTC](https://forum.inductiveautomation.com/t/dynamically-populating-menu-tree-from-database-table/43573/1 "2021-02-18T16:23:22Z")

</div>

Hello,

I’m trying to figure out the best way to dynamically populate Menu Tree component with the data from database. One way I can think of is to bind items prop to a named query and add script transform to format query output into json string. That seems to be rather complicated approach and I’d like to see if somebody has done something like that before and can share it?

Thank you,  
Peter.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [February 19, 2021, 4:03pm UTC](https://forum.inductiveautomation.com/t/dynamically-populating-menu-tree-from-database-table/43573/2 "2021-02-19T16:03:57Z")

</div>

Perhaps this post will help you.

> [@Perspective Tree](http://forum.inductiveautomation.com/t/perspective-tree/38504):
>
> I have a SQL table and used to populate a tree view in vision (for sake of this question I entered bogus data): [treeVision] Query: SELECT a.id, `number` AS `text`, `number` AS `selectedText`, `name` AS `path` FROM tdssql.joblist a INNER JOIN jobcustomer b ON a.custid = b.id WHERE `name` LIKE '%{Root Container.txtlistJobsFilter.text}%' or `number` LIKE '%{Root Container.txtlistJobsFilter.text}%' SQL table: [JobSQL] In vision it was simple, but for the life of me I can’t seem to grasp the …

---

<div class="post-metadata">

**Author:** ![Peter.Dmitriev](https://avatars.discourse-cdn.com/v4/letter/p/7ea924/32.png) [@Peter.Dmitriev](https://forum.inductiveautomation.com/u/Peter.Dmitriev)\
**Post date:** [February 19, 2021, 4:18pm UTC](https://forum.inductiveautomation.com/t/dynamically-populating-menu-tree-from-database-table/43573/3 "2021-02-19T16:18:16Z")

</div>

This does help, thank you very much!
