# Perspective Tree feature - clear \`selectionData\` when \`selection\` is cleared

**URL:** <https://forum.inductiveautomation.com/t/perspective-tree-feature-clear-selectiondata-when-selection-is-cleared/86687>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [March 1, 2024, 6:03pm UTC](https://forum.inductiveautomation.com/t/perspective-tree-feature-clear-selectiondata-when-selection-is-cleared/86687 "2024-03-01T18:03:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [March 1, 2024, 6:03pm UTC](https://forum.inductiveautomation.com/t/perspective-tree-feature-clear-selectiondata-when-selection-is-cleared/86687/1 "2024-03-01T18:03:37Z")

</div>

I keep running into a very annoying bug of the Perspective Tree component, namely, that when the Tree's `selection` property is cleared (so visibly deselecting anything in the tree), the `selectionData` property still retains what was last selected. This is majorly annoying because I have certain containers `visibility` bound to data in `selectionData`, so then the expression is much more complicated than I think it needs to be.

Is there a reason `selectionData` retains it's values even when there is no Tree selection?

**EDIT:** I forgot to say this right away, but the Perspective Table component clears the selection data when the selectedColumn and selectedRow get cleared - that's pretty much what I wish would happen.

---

<div class="post-metadata">

**Author:** ![Shyam](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/shyam/32/42528_2.png) [@Shyam](https://forum.inductiveautomation.com/u/Shyam)\
**Post date:** [May 31, 2024, 6:49am UTC](https://forum.inductiveautomation.com/t/perspective-tree-feature-clear-selectiondata-when-selection-is-cleared/86687/2 "2024-05-31T06:49:57Z")

</div>

Hello @YF129701  
Have you found anyway to fix this?

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [May 31, 2024, 1:57pm UTC](https://forum.inductiveautomation.com/t/perspective-tree-feature-clear-selectiondata-when-selection-is-cleared/86687/3 "2024-05-31T13:57:35Z")

</div>

I think I ended up adding a change script on one of the Tree properties that clears `selectionData` - I can't really remember anymore.
