Using Wilcard in Path for system.tag.browse?

Hello There,

I am just wondering how I can take the following script and modify it to contain a wildcard in the search path. As it stands the script works but I would like to modify it so it searches through all folders within “[MyProject]Root/WellOne” instead of searching only in that single tag folder. I would like it to search through the child folders as well.

Is this possible to do?

Below is my script:

instances = []
filter = “ " + “GasMeter” + "
myPath = ‘[MyProject]Root/WellOne’
results = system.tag.browse(path = str(myPath), filter = {‘name’:filter})

for result in results.getResults():
instances.append({“instanceStyle”:{“classes”:"",“instancePosition”: {}},“TagPath”: value + “/” + result[‘name’]})
return instances

Many thanks

See the “Code Snippet - Recursive Browse” section at the bottom of this page:
https://docs.inductiveautomation.com/display/DOC80/system.tag.browse
It will help you find tags in the child folders.

2 Likes