# Configuring "Is Active" Expression Binding from Script for Alarms

**URL:** <https://forum.inductiveautomation.com/t/configuring-is-active-expression-binding-from-script-for-alarms/109031>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [July 29, 2025, 1:12am UTC](https://forum.inductiveautomation.com/t/configuring-is-active-expression-binding-from-script-for-alarms/109031 "2025-07-29T01:12:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nwalsh](https://avatars.discourse-cdn.com/v4/letter/n/91b2a8/32.png) [@nwalsh](https://forum.inductiveautomation.com/u/nwalsh)\
**Post date:** [July 29, 2025, 1:12am UTC](https://forum.inductiveautomation.com/t/configuring-is-active-expression-binding-from-script-for-alarms/109031/1 "2025-07-29T01:12:32Z")

</div>

I'm attempting to set the "Is Active" expression binding (below) from a script, when in "Mode" is set to "On Condition".

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/d/8da87778ae768c21ff3897f1706d2da9c3aff94a.png)

I understand the "Is Active" property name is named `activeCondition` in scripting, however this is a Boolean value, and I can't seem to write an expression written to it. Is there a way to write to the expression binding from a script, similar to the format below, where `activeConditionExpression` is the scripting name for the "Is Active" expression binding and `myExpression` is the expression I wish to write to this binding?

```python
alarm = {
    "name": tagName,
    "mode": "OnCondition",
    "activeConditionExpression": myExpression
}

```

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 29, 2025, 9:33am UTC](https://forum.inductiveautomation.com/t/configuring-is-active-expression-binding-from-script-for-alarms/109031/2 "2025-07-29T09:33:23Z")

</div>

I suggest you add an expression normally and then export the tag's json and have a look at what the value of that prop is. You will need to follow suit and use `system.tag.configure` to write the config change back to the tag. Ensure that you set the mode to _merge_ changes, _not to overwrite_ them.

e.g.  
Example tag JSON with manually configured (bogus) expression:  
tagpath: [default]System/New Tag

```python
{
  "valueSource": "memory",
  "alarms": [
    {
      "mode": "OnCondition",
      "name": "Alarm",
      "activeCondition": {
        "bindType": "Expression",
        "value": "if({tag}, 5, False)"
      }
    }
  ],
  "name": "New Tag",
  "tagType": "AtomicTag"
}

```

Script to reconfigure it:

```python
cfg = [{
  "name": "New Tag",
  "alarms": [
    {
      "mode": "OnCondition",
      "name": "Alarm",
      "activeCondition": {
        "bindType": "Expression",
        "value": "{OtherTag} = 10"
      }
    }
  ],
}]
folderPath = '[default]System'
system.tag.configure(basePath=folderPath,
	tags=cfg,
	collisionPolicy='m'
)

```

Notes:

- the tag defs must contain at a minimum the `name` key
- all included property values must be complete, not partials. I.e. structures like `alarms`, `writePermissions`, etc. values cannot be provided as partials and _merged_, they must contain the entire structural definitions

---

<div class="post-metadata">

**Author:** ![nwalsh](https://avatars.discourse-cdn.com/v4/letter/n/91b2a8/32.png) [@nwalsh](https://forum.inductiveautomation.com/u/nwalsh)\
**Post date:** [July 29, 2025, 10:59pm UTC](https://forum.inductiveautomation.com/t/configuring-is-active-expression-binding-from-script-for-alarms/109031/3 "2025-07-29T22:59:48Z")

</div>

Thank you very much, exporting to JSON first to get the formatting worked a treat!
