# Converting Table(MsSQL) to tree component in ignition perspective

**URL:** <https://forum.inductiveautomation.com/t/converting-table-mssql-to-tree-component-in-ignition-perspective/36671>\
**Category:** Ignition\
**Tags:** python, ignition80, database, scripting, perspective\
**Created:** [July 14, 2020, 6:45am UTC](https://forum.inductiveautomation.com/t/converting-table-mssql-to-tree-component-in-ignition-perspective/36671 "2020-07-14T06:45:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramkumar.r2](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@ramkumar.r2](https://forum.inductiveautomation.com/u/ramkumar.r2)\
**Post date:** [July 14, 2020, 6:45am UTC](https://forum.inductiveautomation.com/t/converting-table-mssql-to-tree-component-in-ignition-perspective/36671/1 "2020-07-14T06:45:21Z")

</div>

Hello. I am using Ignition perspective to create an application to view energy consumption across several plants. In this application, I want to create a tree that helps the user to navigate to a particular meter among these several plants.  
eg. plant 1\> area 3\> machine 2\> meter 10.

The data is in MsSQL DB with a table structure where all the plants, areas, machines, meters are all listed and mapped to corresponding parent ID.  
eg.  
ID / name / parentID / category  
P001 / plant 1 / - / Plant \<  
P002 / plant 2 / - / Plant  
…  
A001 / Area 1 / P001 / Area  
A002 / Area 2 / P001 / Area  
A003 / Area 3 / P001 / Area \<  
…  
M001 / Machine 1 / A003 / Machine  
M002 / Machine 2 / A003 / Machine \<  
…  
E009 / EnergyMeter 9 / M002/ Energy Meter  
E010 / EnergyMeter 10 / M002/ Energy Meter \<

I would like map this table to the tree component available in the Ignition perspective. There are more than 2000 rows hence creating tags is not a viable option. If there was a solution to map using scripting, that would be great. Please let me know if there is a solution. Thanks.

![tree](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/2/b2709a236d9e9d05ea289cf1a89f010025f3c026.png)

---

<div class="post-metadata">

**Author:** ![antonio\_graham](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@antonio\_graham](https://forum.inductiveautomation.com/u/antonio_graham)\
**Post date:** [June 23, 2023, 1:42pm UTC](https://forum.inductiveautomation.com/t/converting-table-mssql-to-tree-component-in-ignition-perspective/36671/2 "2023-06-23T13:42:44Z")

</div>

Has anyone figured this out? Valuable feature here.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 23, 2023, 1:50pm UTC](https://forum.inductiveautomation.com/t/converting-table-mssql-to-tree-component-in-ignition-perspective/36671/3 "2023-06-23T13:50:07Z")

</div>

By coincidence I have asked a very similar question just a few minutes ago. Any answer to mine may be of interest.

> [@Text tree to Tree component 'items' property](https://forum.inductiveautomation.com/t/text-tree-to-tree-component-items-property/75453/1):
>
> I'm experimenting with using the Tree component for navigation rather than the Menu Tree. It offers the user clear visibility of where in the site they are whereas the Menu Tree doesn't. I'm making the tree configurable within the application (subject to user roles) and want to use a simple markup structure to generate the Tree's props.items. Markup would look like this with the syntax anchor text | page URL. The URL can be passed to the tree's onActionPerformed event to cause a navigation to …
