Hello.
Let's say the following tree structure is showing for a Tag Browse Tree component.
- -ROOT
- -A
- -B
- -C
- -D
- -E
Best.
Hello.
Let's say the following tree structure is showing for a Tag Browse Tree component.
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.
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:
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:
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.
We both are correct in terms of both our assumed scope. 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.
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:
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.
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.
Like minds