How to filter tags and folders in all tag tree browser using one common script instead of running script in all tag tree browser?

after declaring like this

def filter(self,tag):
    if tag.name in self.myFilterFunction.split(','):
        return false

getting this error

Try this:

def filter(self,tag):
    if tag.name in self.myFilterFunction.split(','):
        return false
    else:
        return true

getting this error

global name ‘true’ is not defined

false and true need to be capitalized.

Sorry, typo.

def filter(self,tag):
    if tag.name in self.myFilterFunction.split(','):
        return False
    else:
        return True
1 Like

image

myFilterFunction = ‘Node Info,Node Control’
i have given folder path in custom property

but this is not hiding the folder

any other way to declare it?

i have tired giving directly in tag tree browser

but its not hiding the folder

any other way to do?

Your custom property is a string, not code. Don’t use quotes within it.

1 Like

Hi, i have column containing string value

i am getting output like this [‘calcination temp’,‘weight’,‘wet weight - histogram’]

but actually i want like this calcination temp,weight,wet weight in single row- histogram

in order to pass this to my custom property - myfilterfunction in tag tree browser for filtering

how to query and get output like this calcination temp,weight,wet weight - histogram?

listIn = ','.join(newRows)

1 Like

thanks got it

I Have tag tree browser

image

I am trying to hide folder common inside the line folder, but when i mention like this


if tag.name == 'Common':
		return False

its hiding the all common folder in tag tree browser.

how to hide common folder only in inside of the Line folder?

You’ll have to filter on the path instead of the name.

if 'Line/Common' in tag.path:
    return False
else:
    return True

I’m just guessing at the path, you’ll need to verify that the path string is correct.

If you have more than one path, then you’ll need to develop a method for comparing against a list of paths.

1 Like

image

given like this

but not hiding the path

still common folder is there

[MQTT Engine]Edge Nodes/Vidalengo/Line/Common

this is the full path i have given this also but its not hiding

What you posted is not what @lrose wrote. Did you try:

if 'Line/Common' in tag.path:

?

yes tried but not hiding

so only checked with full path also. but that also not hiding

getting this error after trying @lrose

The tag object is of type com.inductiveautomation.ignition.common.tags.browsing.NodeBrowseInfo. You can’t get the path with tag.path. Need to use .getFullPath().

if `Line/Common` in str(tag.getFullPath()):
3 Likes

Its working Thanks a lot

image

when try to pass more than one path , i am getting this error

how to pass multiple paths to filter

You’ll have to loop through the .split().

2 Likes