Pulling tags from folder with system.tag.browseTags

Hi there, I am trying to get into a specific named folder and take all tags inside. e.g. Folders A/B/C have nested folders called Info. I want all tags from this info folder from all 3 parent folders (A/B/C)

My current code is the following and returns the folders A/B/C:
browseTagArray = system.tag.browseTags()

I tried using the recursive type and specifying a path (only one to test) however, it only returns blank info
browseTagArray = system.tag.browseTags(tagPath = “[Default]A/Info”, recursive = True)

If anyone has pointers/ sees a glaring mistake, please let me know. Cheers!

The last example in the manual should get you going, it is filtering just UDT tags, but you can modify that.
https://docs.inductiveautomation.com/display/DOC80/system.tag.browse

Thanks for your quick response!
I went through a bit of this initially and switched to the 8.1 manual, where they look at it with the recursive condition instead of looping through. Is there any difference in these two methods before I go in deeper?

Sorry, I managed to find the solution! Thanks for all your help :slight_smile:

I would go with system.tag.browse since .browseTags isn’t necessarily going to be around forever. The manual also warns to avoid using the recursive option. That said, the recursion = True should work, i suspect the problem is that you specified a tagPath with no wild cards. Using parentPath would be better.

1 Like