# Modifying Alarm Properties with script

**URL:** <https://forum.inductiveautomation.com/t/modifying-alarm-properties-with-script/77786>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting\
**Created:** [August 13, 2023, 10:48am UTC](https://forum.inductiveautomation.com/t/modifying-alarm-properties-with-script/77786 "2023-08-13T10:48:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [August 13, 2023, 10:48am UTC](https://forum.inductiveautomation.com/t/modifying-alarm-properties-with-script/77786/1 "2023-08-13T10:48:10Z")

</div>

I am trying to update settings in an alarm on a tag, currently displaying the data in a simple Perspective table, double click to edit a cell, and the alarm should change for the tag.  
I have added a "k" in the table cell as seen below.

in the onClick handler:

```auto
def runAction(self, event):

	tagPath = self.getSibling("TextField").props.text
	tagConfig = system.tag.getConfiguration(tagPath,False)
	self.getSibling("Label").props.text = tagConfig
	
	tagConfig[0]['alarms'][event.row][event.column] = event.value
	
	self.getSibling("Label_0").props.text = tagConfig
	system.tag.configure("", tagConfig,"o")
	

```

Contents of "Label":

```auto
[{"path":"[default]Testing/TestAlarms","alarms":[{"setpointA":1,"name":"Test Alarm","label":"Test Alarm 1","displayPath":"Testing ","priority":"Medium"}],"tagType":"AtomicTag","name":"TestAlarms","valueSource":"memory"}]

```

Contents of "Label\_0":

```auto
[{"path":"[default]Testing/TestAlarms","alarms":[{"setpointA":1,"name":"Test Alarm","label":"kTest Alarm 1","displayPath":"Testing ","priority":"Medium"}],"tagType":"AtomicTag","name":"TestAlarms","valueSource":"memory"}]

```

The tag does not get updated.

Any ideas what I have done wrong here?  
Nothing in console, nothing in server Logs.

---

<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:** [August 13, 2023, 12:36pm UTC](https://forum.inductiveautomation.com/t/modifying-alarm-properties-with-script/77786/2 "2023-08-13T12:36:23Z")

</div>

You could just write to the alarm prop via its tag path with tag.write\*

> [@David\_Stone](#):
>
> `system.tag.configure("", tagConfig,"o")`

This is what's wrong though, the blank starting path should be

```python
parentPath = '/'.join(tagPath.split("/")[:-1])

```

Of course, you'll need to possibly accommodate for tagPaths that are in the root

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [August 13, 2023, 11:49pm UTC](https://forum.inductiveautomation.com/t/modifying-alarm-properties-with-script/77786/3 "2023-08-13T23:49:50Z")

</div>

That's perfect, I had been trying with the entire path, no wonder that also didn't work.
