# How to get label of parent node even the child tree is selected in Tree View Perspective

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-label-of-parent-node-even-the-child-tree-is-selected-in-tree-view-perspective/54628>\
**Category:** Ignition\
**Created:** [January 4, 2022, 8:39am UTC](https://forum.inductiveautomation.com/t/how-to-get-label-of-parent-node-even-the-child-tree-is-selected-in-tree-view-perspective/54628 "2022-01-04T08:39:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![manjuyadav95.m](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@manjuyadav95.m](https://forum.inductiveautomation.com/u/manjuyadav95.m)\
**Post date:** [January 4, 2022, 8:39am UTC](https://forum.inductiveautomation.com/t/how-to-get-label-of-parent-node-even-the-child-tree-is-selected-in-tree-view-perspective/54628/1 "2022-01-04T08:39:43Z")

</div>

this is my tree view and I want the script to get the label of the parent node(Screen1/Screen2) even though the child node(item1/item2) is selected and to send that label string further to another view/session custom prop coz items view gonna be same for all screens but only screen name gonna change so how can I get the parent node(Screen1/Screen2) …plz help me

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/e/3e1daecb808338858c2220272ecd95071ef31e86.png)

---

<div class="post-metadata">

**Author:** ![lachguerabdallah](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lachguerabdallah/32/25558_2.png) [@lachguerabdallah](https://forum.inductiveautomation.com/u/lachguerabdallah)\
**Post date:** [January 4, 2022, 9:07am UTC](https://forum.inductiveautomation.com/t/how-to-get-label-of-parent-node-even-the-child-tree-is-selected-in-tree-view-perspective/54628/2 "2022-01-04T09:07:45Z")

</div>

[treeTest\_2022-01-04\_0505.zip](https://forum.inductiveautomation.com/uploads/short-url/x1sM9i3y0NkEa0FRXMNo89JPaQf.zip) (5.7 KB)  
try importing the view that I attach

---

<div class="post-metadata">

**Author:** ![manjuyadav95.m](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@manjuyadav95.m](https://forum.inductiveautomation.com/u/manjuyadav95.m)\
**Post date:** [January 4, 2022, 9:35am UTC](https://forum.inductiveautomation.com/t/how-to-get-label-of-parent-node-even-the-child-tree-is-selected-in-tree-view-perspective/54628/3 "2022-01-04T09:35:01Z")

</div>

this is what I want …Thanks a lot 👍 🙂 😍

---

<div class="post-metadata">

**Author:** ![Yogesh\_Garud](https://avatars.discourse-cdn.com/v4/letter/y/db5fbb/32.png) [@Yogesh\_Garud](https://forum.inductiveautomation.com/u/Yogesh_Garud)\
**Post date:** [February 21, 2023, 6:31pm UTC](https://forum.inductiveautomation.com/t/how-to-get-label-of-parent-node-even-the-child-tree-is-selected-in-tree-view-perspective/54628/4 "2023-02-21T18:31:00Z")

</div>

Hello,  
Is there any way to get the path in label format? I need to show specific hierarchy levels in the header.  
like: site\>department\>line\>machineName

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/6/a6c473cc8e3b68ebd7ad40b814e02ea84571af2a.png)

Thanks.
