results = system.tag.browse (path = ‘[default]’, filter = {‘name’: ‘*M*’})
for result in results.getResults():
print result
The above script is copied from the online user manual.
After changing the ‘name’ filter from ‘*M*’ to ‘*a*’ and de code is executed we get some results.
However, after changing the ‘name’ filter from ‘*a*’ to ‘*aa*’ we don’t get any results (there are some tags available with ‘aa’ in their tagname).
Can someone give us a push in the right direction to solve this problem?
You using the wrong quotes. Use regular single quotes, or double quotes.
like this
results = system.tag.browse(path = '[default]', filter = {'name': '*M*'})
for result in results.getResults():
print result
EDIT:
Also, using just [default] as the filter, it will only look at tags and folders directly in [default]. If your tags are in a folder, then you need to specify path = '[default]folderName/subFolderIfNeeded'
Hi, I have the same problem but with the ‘typeId’ property. When I give the entire name of the UDT type it works, but when I’m using the wildcard then it doesn’t return anything.
I have two UDT that have almost the same name (UDT_H2O2_Filtration and UDT_CLO2_Filtration) and then I tried to write the following filter in argument of the function to retrieve all instances of these 2 UDTs but it returns an empty array :