# Search/Filter on tree data

**URL:** <https://forum.inductiveautomation.com/t/search-filter-on-tree-data/76513>\
**Category:** Ignition\
**Tags:** scripting, perspective\
**Created:** [July 18, 2023, 12:19pm UTC](https://forum.inductiveautomation.com/t/search-filter-on-tree-data/76513 "2023-07-18T12:19:40Z")\
**Posts on this page:** 1\
**Showing post:** 7

<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 18, 2023, 7:30pm UTC](https://forum.inductiveautomation.com/t/search-filter-on-tree-data/76513/7 "2023-07-18T19:30:33Z")

</div>

A recursive script would likely be needed. If you have the source data in a flat format, then the technique in this post might help, by filtering (with `where()`) then generating the tree:

> [@Automation Professionals' Integration Toolkit Module](https://forum.inductiveautomation.com/t/automation-professionals-simulation-aids-v2/74934/13):
>
> No longer true. grin For Ignition v8.1+: v2.0.3.231942018 With @Matthew.gaitan 's input dataset in a custom property named source, this expression: forEach( asMap( groupBy( {this.custom.source}, it()['RouteName'], it()['StopName'] ) ), asMap( 'label', it()[0], 'expanded', false, 'data', asMap('nodeType', 'Route'), 'items', forEach( it()[1], asMap( 'label', it()[0], 'expanded', false, 'data', asMap('nodeType', 'Stop'), 'items', forEach( it(…

---

_[View the full topic](https://forum.inductiveautomation.com/t/search-filter-on-tree-data/76513)._
