In Vision, how to hide particular folders in a Tag Browse Tree component?

Hello.

Let's say the following tree structure is showing for a Tag Browse Tree component.

-ROOT
-A
-B
-C
-D
-E
Is there a way to hide folders B and E? Is there a way of hiding these folders via the filterTag extension function?

Best.

Yes.

As explained in the Description of the extention function.

Return false to hide this tag from the tree

So something like:

if tag in (B,E):
    return False

What have you tried?

Unfortunately, it looks like there is only one option for filtering down the list.
image

you can filter down to one provider, but it doesn't look like there are options to include different providers.

even looking at the filterTag extension function:
image

this only looks at actual tags, not the providers.
Here is the docs for that: Vision - Tag Browse Tree Scripting Functions | Ignition User Manual (inductiveautomation.com)

Some questions to ask yourself/stakeholder:

  • Do you need to look at more than 1 provider?
  • Are there specific tags I need to choose from (IE could I have one provider with all the tags I need in it)?
  • How else would we want the UI to look, can we slim down the scope of the screen we are needing to select for and only need one provider for that screen?

the level under ROOT are the Providers, which are not affected by the extension function. Though the tags would not show up, the folders for the providers would just still be there empty.

I assumed that -ROOT was a ROOT folder, not "THE ROOT" folder, because of the generic nature of the OP. Perhaps a poor assumption on my part.

As you have said the providers are not effected by the extension function.

1 Like

We both are correct in terms of both our assumed scope. :blue_heart: Like you had said depends on the OPs scope of what he means as ROOT.

My apologies for not providing a clearer explanation.
Prior to posting, I read in the manual the description and usage of the filterTag extension. I also read other posts in the forum regarding this extension trying to find any hint on how this could be done. I tried a couple of things but I was not successful. Here is a partial screenshot of the tree.
image

We would like to hide CMMS as there is no use for this provider to show up in the window we built. It confuses the users a bit. The tree is used by a user to drag and drop tags into an easy chart where they can trend multiple tags.

After reading through your posts, it seems filterTag can't hide Provider's folders.

Is there a way of only exposing certain providers in the tree?

Best.

There isn't a way to expose more than one provider at a time. It is all or one it seems based on the way the Root Node Path property works. You can't have multiple Root Node Paths in there unfortunately.

The Tag Tree components in both Vision and Perspective lack functionality when it comes to filtering the tags you see.

this might be a good workaround:

Create a custom property somewhere to store what providers you want to use, or make a template with params

this dataset will be able to be dynamic.

Then use a Tree View Component:
image

Add a binding on the Items Property under the Data Section

I would then utilize system.tag.browse inside of a function in the script library. This will do something like the following

def getTagTreeForProviders(providerDataset):
	#Loop over each row inside of your dataset
	for row in range(providerDataset.getRowCount()):
		#Call the browse funciton for each provider you wish to look at
		system.tag.browse(providerDataset.getValueAt(row,0))

The only issue with this is you will have to recursively run system.tag.browse for each tag where 'hasChildren' == True.

You would then return the data to be in the proper format for the Tree Component and have to value in the section be tag fullPath of the tag which will include which provider it is in.

There may be a better way than this, but off the top of my head this is how we have done similar things in the past, but with Perspective, where binding transforms make this a little easier to digest.

1 Like

Years ago, when i wanted to have more customization from the Tag Browse tree, i ended up replacing it with the Tree View component instead, along with a script to build the dataset that feeds it based on a few criteria specific to the project.

1 Like

Like minds :sunglasses:

1 Like