Filter tags with datatype

Hello,

I need to filter the Document type tags to only show in the Perspective - Tag Browse Tree component.

I've used the filterBrowseNode script, as per the documentation here:
Perspective - Tag Browse Tree Scripting | Ignition User Manual.

The script is returning the correct results, but I need the following adjustments:

  1. Include only history-enabled tags.
  2. Exclude any empty tag folders.

Please let me know if this can be done by any other method.

	# Print the node for debugging
	system.perspective.print(node)
	
	# Check if the node has a 'dataType' attribute or is a folder
	if hasattr(node, 'dataType') and str(node.dataType) == 'Document':
	    # Return True if the dataType is 'Document'
	    return True
	
	# Check if the node is a Folder
	if hasattr(node, 'objectType') and str(node.objectType) == 'Folder':
	    return True
	
	# If none of the above conditions are met, exclude the node
	return False

Thanks in advance :slightly_smiling_face:

  1. Should be able to check for the "historyEnabled" attribute.
  2. Not possible just with the data handed to the component.

For the latter, consider using system.tag.query() in a project library script, called from a startup event, to cache the desired information. Then the component can simply check the cache.