# Tree in perspective, multiselect label

**URL:** <https://forum.inductiveautomation.com/t/tree-in-perspective-multiselect-label/56661>\
**Category:** Ignition\
**Created:** [March 1, 2022, 8:17am UTC](https://forum.inductiveautomation.com/t/tree-in-perspective-multiselect-label/56661 "2022-03-01T08:17:44Z")\
**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:** [March 1, 2022, 8:17am UTC](https://forum.inductiveautomation.com/t/tree-in-perspective-multiselect-label/56661/1 "2022-03-01T08:17:44Z")

</div>

I need the selectionData prop’s value to be filled when selected from tree as selectionData prop’s itemPath does…  
see attached screenshot job1 is passed by triggering event from onItemClicked  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/2/22a7da6890a5a4e87b0e984c218c77a03fb42bf4.png)

```auto
self.props.selectionData[0].value=event.label

```

I want the selected item’s label in selectionData Prop’s value evenif multiselection done …plz help any one  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/3/f3467c5aecfb7df780d460e1a2b3e26f79c60dd0.png)

but I wanted to do multi selection so how the respective path’s value can be passed ? plz help

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [March 1, 2022, 10:26am UTC](https://forum.inductiveautomation.com/t/tree-in-perspective-multiselect-label/56661/2 "2022-03-01T10:26:08Z")

</div>

create a custom property of type array named “multiselectData”  
create an OnItemClick event on the tree which adds this script

```auto
event['itemPath'] = '/'.join(map(str,event['itemPath'])) 
for index, item in enumerate(self.custom.multiselectData): 
  if item.itemPath == event.itemPath: 
    del self.custom.multiselectData[index]
    break 
  else: 
    self.custom.multiselectData.append(event) 
self.props.selection = [x.itemPath for x in self.custom.multiselectData] 
self.props.selectionData = self.custom.multiselectData 

```

it causes some flikker on the selection style but its the best i can think of xd  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/b/cbe35054b5411c5a384207f772ee2451d619b953.png)

---

<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:** [March 1, 2022, 10:40am UTC](https://forum.inductiveautomation.com/t/tree-in-perspective-multiselect-label/56661/3 "2022-03-01T10:40:18Z")

</div>

Thanks for your reply…I just now found the solution and came to inform here…by giving the item’s label value to data value under items prop, the selectionData prop’s value is taking value from data(item’s prop) on its own  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/1/91b31657dd49e3a2dbb06ba0f7692e2e379546c0.png)

plz help me to get the list of the all the selectedItems to pass in database

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [March 1, 2022, 10:46am UTC](https://forum.inductiveautomation.com/t/tree-in-perspective-multiselect-label/56661/4 "2022-03-01T10:46:35Z")

</div>

hehe i guess that is better, i also thought multiselect wasnt possible on the tree guess i should have tested that first lol

anyways  
best to use prepUpdate to insert into a db  
[https://docs.inductiveautomation.com/display/DOC81/system.db.runPrepUpdate](https://docs.inductiveautomation.com/display/DOC81/system.db.runPrepUpdate)
