Change Tag Property Datatype From Script

Let’s say I have a tag like this:

{
  "valueSource": "memory",
  "alarms": [
    {
      "mode": "AboveValue",
      "setpointA": 10.0,
      "name": "SAMPLE_HIGH",
      "label": {
        "bindType": "Expression",
        "value": "{[.]sample.Documentation}+\" Low\""
      }
    }
  ],
  "documentation": "Fancy Name",
  "name": "sample",
  "value": 5,
  "tagType": "AtomicTag"
}

If I wanted to remove the alarm label or change it to a simple string instead of a binding, is there any sane way to do that in scripting?

The only way I’ve found to remove the property in a script is to use system.tag.configure in overwrite mode. This disturbs other properties like resetting the tag quality to good, and often triggers an alarm initial event, both of which I’d like to avoid.

If I try to replace the property with a value of a different datatype using system.tag.configure in merge mode, it seems to just be ignored. The only way I’ve found to do this in scripting is to use system.tag.configure in overwrite mode, which has the same issues as removing the property.

This issue applies to other general tag properties beside alarm fields, that’s just what I’m using for my example.