System.tag.browse returns data ignoring the filter

Hi!

This is my tag:

{
  "valueSource": "memory",
  "name": "memory",
  "tagType": "AtomicTag"
}

This is my code:

system.tag.browse(
	"[default]memory", 
	filter={"tagType": "AtomicTag"}
)

And even the filter is set to only return AtomicTags the returned data is this:

Result
[
  {
    "fullPath": "[default]memory.valueSource",
    "hasChildren": false,
    "name": "ValueSource",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.engHigh",
    "hasChildren": false,
    "name": "EngHigh",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.documentation",
    "hasChildren": false,
    "name": "Documentation",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.CanWrite",
    "hasChildren": false,
    "name": "CanWrite",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.tooltip",
    "hasChildren": false,
    "name": "Tooltip",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.formatString",
    "hasChildren": false,
    "name": "FormatString",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.tagGroup",
    "hasChildren": false,
    "name": "TagGroup",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.enabled",
    "hasChildren": false,
    "name": "Enabled",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.engUnit",
    "hasChildren": false,
    "name": "EngUnit",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.engLow",
    "hasChildren": false,
    "name": "EngLow",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.quality",
    "hasChildren": false,
    "name": "Quality",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.readOnly",
    "hasChildren": false,
    "name": "ReadOnly",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.CanRead",
    "hasChildren": false,
    "name": "CanRead",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.name",
    "hasChildren": false,
    "name": "name",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.alarmEvalEnabled",
    "hasChildren": false,
    "name": "AlarmEvalEnabled",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.historyEnabled",
    "hasChildren": false,
    "name": "HistoryEnabled",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.deadband",
    "hasChildren": false,
    "name": "Deadband",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.value",
    "hasChildren": false,
    "name": "value",
    "tagType": "Property"
  },
  {
    "fullPath": "[default]memory.timestamp",
    "hasChildren": false,
    "name": "Timestamp",
    "tagType": "Property"
  }
]

Any idea why is returning the properties?

Because you are browsing the tag, not the folder containing the tag. All properties of an atomic tag belong to an atomic tag, satisfying your filter.

Well, that doesn't help my current code...

Thx pturmel!

Perhaps you should be using system.tag.getConfiguration, or perhaps system.tag.query.

I'm trying to return a list of tags based on a Tag Browse Tree selection.

If you select a folder you should get all the tags inside (not any folder).
If you select the tag you should only get the tag.

My thinking process was, if you select a tag, you wouldn't get any result (type = AtomicTag), so you simply read the father path with the name as filter. Then you would only get that tag.

However, because you get the properties I can't do that.

First call system.tag.getConfiguration and examine the tag type. Branch accordingly.

1 Like