# Text tree to Tree component 'items' property

**URL:** <https://forum.inductiveautomation.com/t/text-tree-to-tree-component-items-property/75453>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [June 23, 2023, 1:30pm UTC](https://forum.inductiveautomation.com/t/text-tree-to-tree-component-items-property/75453 "2023-06-23T13:30:14Z")\
**Posts on this page:** 1\
**Showing post:** 1

<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:30pm UTC](https://forum.inductiveautomation.com/t/text-tree-to-tree-component-items-property/75453/1 "2023-06-23T13:30:15Z")

</div>

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 the URL specified in `props.selection.0.value.url`.

```auto
A001 |/Home
A001/B001 |/Area/1/Bath/1
A001/B001/C001 |/Area/1/Bath/1/Clamp1
A001/B001/C002 |/Area/1/Bath/1/Clamp2
A001/B001/C003 |/Area/1/Bath/1/Clamp3
A002 |/Area/2
A002/B001 |/Area/2/Bath/1
A002/B002 |/Area/2/Bath/2
A003 |/Area/3
A003/B001 |/Area/3/Bath/1
A003/B001/C001 |/Area/3/Bath/1/Clamp1
A003/B001/C002 |/Area/3/Bath/1/Clamp1
A003/B001/C003 |/Area/3/Bath/1/Clamp1

```

I would appreciate some help in generating the items list for the tree.

Each item is a dictionary of form,

```auto
{
    "label": "Anchor text goes here.",
    "expanded": false,
    "data": {
        "url": "Page URL goes here."
    },
    "items": []
}

```

Could anyone give me a starter on a recursive procedure to generate the items based on the markup and dictionary template?

Many thanks.

---

_[View the full topic](https://forum.inductiveautomation.com/t/text-tree-to-tree-component-items-property/75453)._
