# Need to bind Tree component label with dynamic values via scripting

**URL:** <https://forum.inductiveautomation.com/t/need-to-bind-tree-component-label-with-dynamic-values-via-scripting/108994>\
**Category:** General Discussion\
**Tags:** ignition81, perspective\
**Created:** [July 28, 2025, 9:42am UTC](https://forum.inductiveautomation.com/t/need-to-bind-tree-component-label-with-dynamic-values-via-scripting/108994 "2025-07-28T09:42:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GOKULAKANNAN\_P](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@GOKULAKANNAN\_P](https://forum.inductiveautomation.com/u/GOKULAKANNAN_P)\
**Post date:** [July 28, 2025, 9:42am UTC](https://forum.inductiveautomation.com/t/need-to-bind-tree-component-label-with-dynamic-values-via-scripting/108994/1 "2025-07-28T09:42:03Z")

</div>

Hi,

I'm using the **Tree component in Perspective** , and I'm dynamically setting its `items` property through a script (e.g., onStartup and on a Refresh button).

In the label field of each item, I’m concatenating values like name, tag value, and unit. It works, but the values **only update when the script runs** , so it's not ideal for live updates.

Since I'm dynamically generating the whole `items` structure, I want to **bind each item's label** to a tag value + unit **through scripting** — not manually in the designer.

Is there a way to **add a binding to the `label` property of Tree items** via script, so it updates automatically when the tag changes?

Thanks in advance 🙂!  
Gokulakannan.P

---

<div class="post-metadata">

**Author:** ![Ujwal\_Wankhede](https://avatars.discourse-cdn.com/v4/letter/u/4af34b/32.png) [@Ujwal\_Wankhede](https://forum.inductiveautomation.com/u/Ujwal_Wankhede)\
**Post date:** [July 28, 2025, 10:40am UTC](https://forum.inductiveautomation.com/t/need-to-bind-tree-component-label-with-dynamic-values-via-scripting/108994/2 "2025-07-28T10:40:36Z")

</div>

Consider leveraging property bindings directly on the items prop itself.  
Move your logic from onStartup script to items prop. Add source data using Expression / Expression Structure and use Script transform for your logic. Construct each item's label using those live values, so the Tree reflects updates in real time.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 28, 2025, 10:41am UTC](https://forum.inductiveautomation.com/t/need-to-bind-tree-component-label-with-dynamic-values-via-scripting/108994/3 "2025-07-28T10:41:15Z")

</div>

No. Run your script at a repeating pace.
