[FEATURE] Add option to system.tag.getConfiguration to match output of tag browser `copy JSON`

When you use system.tag.getConfiguration to get the configuration of UDt instances, it retrieves all non-default configuration of the UDT definition’s tags by deep recursively searching.
If you compare this to the Tag Browser’s copy JSON functionality, this only copies the properties of the UDT definition tags that are overridden at face value, as well as of the name and tagType.

When using getConfiguration with configure, the output from copy JSON is required otherwise you will essentially be overriding the UDT Instance tags with all of the non-default properties that have been set on the tags in the UDT Definition, thus defeating the purpose of a UDT.

For example, take this UDT Definition:

{
  "name": "TEST",
  "tagType": "UdtType",
  "tags": [
    {
      "valueSource": "memory",
      "name": "New Tag",
      "tooltip": "This is a great tag!",
      "value": 999,
      "tagType": "AtomicTag",
      "engUnit": "bob"
    }
  ]
}

This is the output from Copy JSON copying an instance of this UDT:

{
  "name": "Test Instance",
  "typeId": "_TESTING/TEST",
  "tagType": "UdtInstance",
  "tags": [
    {
      "name": "New Tag",
      "tagType": "AtomicTag"
    }
  ]
}

And this is the output from system.tag.getConfiguration:

[{
        "path": "[default]_TESTING/Test Instance",
        "tagType": "UdtInstance",
        "name": "Test Instance",
        "typeId": "_TEST/TEST",
        "tags": [{
                "path": "New Tag",
                "tooltip": "This is a great tag!",
                "tagType": "AtomicTag",
                "name": "New Tag",
                "engUnit": "bob",
                "valueSource": "memory",
                "value": "999"
            }
        ]
    }
]

If I was to use configure with the getConfiguration output, I would apply all of that tag config as overrides in the instance, thus practically unlinking all of the tag config from the UDT definition

I’m requesting that an argument be added into the getConfiguration function to determine what configuration to get: all non-default properties using a deep recursive search, or just the non-defaults at face value.

Vote here:

3 Likes