[FEATURE] Tag Report Tool - Add option to Copy JSON with folder structure intact

I want to use the tag report tool to filter tags for me and then be able to export the tag JSON of the results with the folder structure intact, but the existing "Copy JSON Def" context option just exports a flat list of the tags with no folder structure.

1 Like

What folder structure? The results are a flat list.

The tagpaths have a folder structure :face_with_raised_eyebrow:

True, but the results from system.tag.query() are a list. You are on your own for any desired hierarchy.

At the moment I am, hence the request for a feature, lol. However, it would be a feature of the UI, not the script function (the script function doesn't have a JSON "export" format currently, whereas the UI for it does)

that's objectively weird though, since the internal DB structure maintains hierarchy

1 Like

Exactly. The fact that the only function to get the JSON, exports the tags in a flat structure without their paths even visible is very strange and more or less useless. Consider results that came from finding all tags with the name "Status". The exported "JSON Def" list would contain a list of many dicts in a flat list, all with the same name and no reference back to the folder structures they came from

I've built some internal tools for querying a postprocessed gateway backup that do handle this (as part of the larger dev toolset my team is building)

Sounds handy, I haven't written any tools yet for gw backups, but I have written plenty for development and smooshed them into a PyQt6 interface (much better and infinitelymore powerful than tkinter if you've ever used that, fwiw).

I just wrote a function to produce this tag JSON now too. It's a bit annoying as it needs you to copy the table results and the JSON def into the tool manually which it then uses to produce the structured tag JSON. But it works and I won't need it very often.. Still would be nicer to have in the TRT itself

Include "Full Path" as an output column. fullPath exists in the scripted results list whether requested or not, and is an actual BasicTagPath object.