# Tag Browse Tree - Do NOT Show Empty Folders

**URL:** <https://forum.inductiveautomation.com/t/tag-browse-tree-do-not-show-empty-folders/104659>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [April 3, 2025, 5:13pm UTC](https://forum.inductiveautomation.com/t/tag-browse-tree-do-not-show-empty-folders/104659 "2025-04-03T17:13:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liam\_Dietrich](https://avatars.discourse-cdn.com/v4/letter/l/b5a626/32.png) [@Liam\_Dietrich](https://forum.inductiveautomation.com/u/Liam_Dietrich)\
**Post date:** [April 3, 2025, 5:13pm UTC](https://forum.inductiveautomation.com/t/tag-browse-tree-do-not-show-empty-folders/104659/1 "2025-04-03T17:13:52Z")

</div>

Ignition Version 8.1.44 - Perspective

**Current Use:**  
I am using the TagBrowseTree's extension function, _filterBrowseNode_, to only return tags with history.

```python
from com.inductiveautomation.ignition.common.tags.browsing import NodeAttribute
return node.attributes.contains(NodeAttribute("history")) or node.hasChildren()

```

**Issue:**  
The TagBrowseTree currently shows empty folders in the tag browser.

**Goal:**  
Continue to filter the tree to only show tags with history, but **only shows folders that contain tags with history**.

Any suggests are greatly appreciated, thanks!

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [April 3, 2025, 5:33pm UTC](https://forum.inductiveautomation.com/t/tag-browse-tree-do-not-show-empty-folders/104659/2 "2025-04-03T17:33:29Z")

</div>

You will need to remove `node.hasChildren()` from the return, and write a recursive filter function.

---

<div class="post-metadata">

**Author:** ![Liam\_Dietrich](https://avatars.discourse-cdn.com/v4/letter/l/b5a626/32.png) [@Liam\_Dietrich](https://forum.inductiveautomation.com/u/Liam_Dietrich)\
**Post date:** [April 3, 2025, 6:28pm UTC](https://forum.inductiveautomation.com/t/tag-browse-tree-do-not-show-empty-folders/104659/3 "2025-04-03T18:28:14Z")

</div>

Thank you for the reply!

I have previously attempted using recursion in this instance, but I am unsure how to iterate through the children nodes.

I have attempted:

```python
for child in node:
for child in node.getChildren():
for child in node.getChildNodes():
for child in node.iterate():

```

If you have any insight on how to iterate through the child nodes, or don't think that it is necessary, and have any suggestions please let me know.

---

<div class="post-metadata">

**Author:** ![zcoogan55](https://avatars.discourse-cdn.com/v4/letter/z/779978/32.png) [@zcoogan55](https://forum.inductiveautomation.com/u/zcoogan55)\
**Post date:** [January 8, 2026, 9:22pm UTC](https://forum.inductiveautomation.com/t/tag-browse-tree-do-not-show-empty-folders/104659/4 "2026-01-08T21:22:40Z")

</div>

I have also run into this issue. It seems the node objects themselves only have the following attributes:  
name, dataType, currentValue, objectType, subTypeId, attributes, hasChildren, displayFormat, and tooltip. None of which seem to allow interacting with their children.

Were you able to find a solution or work-around for this?

---

<div class="post-metadata">

**Author:** ![Nol](https://avatars.discourse-cdn.com/v4/letter/n/8e8cbc/32.png) [@Nol](https://forum.inductiveautomation.com/u/Nol)\
**Post date:** [January 8, 2026, 9:49pm UTC](https://forum.inductiveautomation.com/t/tag-browse-tree-do-not-show-empty-folders/104659/5 "2026-01-08T21:49:43Z")

</div>

Fair bit of discussion in here on similar issue

> [@\[POSSIBLE\] How to filter history-only tags in the Tag Browse Tree](https://forum.inductiveautomation.com/t/possible-how-to-filter-history-only-tags-in-the-tag-browse-tree/61955/):
>
> Like the title says, I’d like to get the Perspective Tag Browse Tree component to display only tags that have history enabled. It looks like it can be done (reading the javadocs) but I’m not exactly sure how to implement it. [Here](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.16/com/inductiveautomation/factorypmi/application/components/tagbrowsetree/TagBrowseTreeFilter.html) is a link to the page I’m looking at with two relevant passages: It seems like includeRealtimeWithHistory is the field I want to set to True, but how do I do that on the component’s filterBrowseNode extension function?
