# Getting Tag Browser Tree to work with UDTs

**URL:** <https://forum.inductiveautomation.com/t/getting-tag-browser-tree-to-work-with-udts/65385>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [October 19, 2022, 9:04am UTC](https://forum.inductiveautomation.com/t/getting-tag-browser-tree-to-work-with-udts/65385 "2022-10-19T09:04:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cosminroger](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cosminroger](https://forum.inductiveautomation.com/u/cosminroger)\
**Post date:** [October 19, 2022, 9:04am UTC](https://forum.inductiveautomation.com/t/getting-tag-browser-tree-to-work-with-udts/65385/1 "2022-10-19T09:04:12Z")

</div>

I am currently trying to get the Tag Brwoser Tree to only display the UDTs. I have tried to change the root source to match "[provider]_types_/" but it doesn't work. Any suggestions on how to get it to work?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 19, 2022, 10:11am UTC](https://forum.inductiveautomation.com/t/getting-tag-browser-tree-to-work-with-udts/65385/2 "2022-10-19T10:11:29Z")

</div>

> [@cosminroger](#):
>
> "[provider]_types_/"

Where was that documented?

---

<div class="post-metadata">

**Author:** ![deon.korb](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@deon.korb](https://forum.inductiveautomation.com/u/deon.korb)\
**Post date:** [October 19, 2022, 10:16am UTC](https://forum.inductiveautomation.com/t/getting-tag-browser-tree-to-work-with-udts/65385/3 "2022-10-19T10:16:48Z")

</div>

It is actually `[Provider]_types_/` with underscores, but was styled in his post.

Don't know about documentation, but it copies it with the tag path from the designer tag browser.

---

<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:** [October 19, 2022, 11:31am UTC](https://forum.inductiveautomation.com/t/getting-tag-browser-tree-to-work-with-udts/65385/4 "2022-10-19T11:31:40Z")

</div>

Vision or Perspective?

Generally, you would treat them similarly to folders. Are you trying to only show UDT's? Do you want UDT Instances or UDT Definitions?

---

<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:** [October 19, 2022, 11:43am UTC](https://forum.inductiveautomation.com/t/getting-tag-browser-tree-to-work-with-udts/65385/5 "2022-10-19T11:43:47Z")

</div>

I think the tag browsers filter out the definitions themselves.

---

<div class="post-metadata">

**Author:** ![cosminroger](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cosminroger](https://forum.inductiveautomation.com/u/cosminroger)\
**Post date:** [October 20, 2022, 8:30am UTC](https://forum.inductiveautomation.com/t/getting-tag-browser-tree-to-work-with-udts/65385/6 "2022-10-20T08:30:15Z")

</div>

The workaround I found, for now, was to set up a script that makes a list with all UDTs, converts the list to a dataset, and use it in combination with the Tree View component.

---

<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:** [October 20, 2022, 4:06pm UTC](https://forum.inductiveautomation.com/t/getting-tag-browser-tree-to-work-with-udts/65385/7 "2022-10-20T16:06:35Z")

</div>

If what you are trying to present is a view of the UDT Definitions then, I believe your way is the only way.

If however you want to show UDT Instances, then you can do that with the Tag Browse Tree.

In the `filterTag` extension function use this script. It will filter out all tags except those which are UDT instances, and Atomic tags that are children of a UDT Instance.

NOTE: This assumes a Tag Browse Tree in Vision

```python
from com.inductiveautomation.ignition.common.tags.config.types import TagObjectType

if tag.hasChildren() or tag.objectType == TagObjectType.UdtInstance:
	return True

if tag.objectType == TagObjectType.AtomicTag:
	parentConfig = system.tag.getConfiguration(tag.fullPath.parentPath,False)
	if parentConfig[0]['tagType'] == TagObjectType.UdtInstance:
		return True
		
return False

```

I suppose it is also possible to browse forward and determine if a folder has any children that should be displayed, effectively eliminating "Empty Folders". Beware though, you're calling a potentially long running task here so the result may be less than desired. If you have a moderately large tag structure, you should almost certainly off load this to a back ground thread. As it is, it will lock up the GUI until the filter is completed (I have around 30K tags and it took ~2s). Basically, I'm too lazy to do it right now.

```python
###################
#Caution: This is a potentially long running task that will block the gui thread while
#it executes.

from com.inductiveautomation.ignition.common.tags.config.types import TagObjectType

if tag.objectType == TagObjectType.Folder:
	results = system.tag.browse(tag.fullPath,{'tagType':'UdtInstance','recursive':True}).getResults()
	if results:
		return True
	return False

if tag.objectType == TagObjectType.UdtInstance:
	return True

if tag.objectType == TagObjectType.AtomicTag:
	parentConfig = system.tag.getConfiguration(tag.fullPath.parentPath,False)
	if parentConfig[0]['tagType'] == TagObjectType.UdtInstance:
		return True
		
return False

```

---

<div class="post-metadata">

**Author:** ![Jonathon\_Taylor](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@Jonathon\_Taylor](https://forum.inductiveautomation.com/u/Jonathon_Taylor)\
**Post date:** [August 11, 2025, 11:47pm UTC](https://forum.inductiveautomation.com/t/getting-tag-browser-tree-to-work-with-udts/65385/8 "2025-08-11T23:47:50Z")

</div>

I needed something like this for Perspective… didn’t find anything; this works:

```python
def filterBrowseNode(self, node):
	"""
	Production version of filter: Includes folders and UDT instances, with minimal error handling.
	"""
	try:
		# Get node details
		name = node.getName()
		object_type = str(node.getObjectType()).strip().lower() # Normalize ObjectType to a string
		full_path = node.getFullPath() # Retrieve node's full path

		# Allow folders
		if object_type == "folder":
			return True

		# Allow UDT instances
		if object_type == "udtinstance":
			return True

		# Exclude everything else
		return False

	except Exception as e:
		# Log unexpected errors for diagnosis
		system.perspective.print("ERROR in filterBrowseNode: {}".format(str(e)))
		return False

```
