# How can I change an alarm setpoint using a script action?

**URL:** <https://forum.inductiveautomation.com/t/how-can-i-change-an-alarm-setpoint-using-a-script-action/27911>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [August 30, 2019, 5:05pm UTC](https://forum.inductiveautomation.com/t/how-can-i-change-an-alarm-setpoint-using-a-script-action/27911 "2019-08-30T17:05:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![goldbergg](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@goldbergg](https://forum.inductiveautomation.com/u/goldbergg)\
**Post date:** [August 30, 2019, 5:05pm UTC](https://forum.inductiveautomation.com/t/how-can-i-change-an-alarm-setpoint-using-a-script-action/27911/1 "2019-08-30T17:05:11Z")

</div>

I am trying to configure a script action on a button so that the following occurs when it is pushed:

- it gets the current value of a nearby numerical field entry box
- it writes that value to the setpoint of an alarm on a tag (the tag path will be dynamically selected using a system of parameters)

I know how to bind an alarm’s setpoint to a memory tag, but I don’t want to go that route because then I would have to create a bunch of new individual memory tags for every setpoint of every alarm. I want to be able to call the setpoint of an alarm directly through an address.

I found [this post](http://forum.inductiveautomation.com/t/edit-alarm-setpoint-from-client/7359) from a few years ago but I think it’s outdated (system.tag.editTag doesn’t seem to exist anymore)

I’ve tried using writeBlocking to do it, like this:

```auto
        newvalue = self.getsibling('NumericEntryField').value
	newvalue_as_list = [newvalue]
	setpointPath_as_list = [{self.view.params.tag_alarm_path}.setpointA]
	SP_write = system.tag.writeBlocking(setpointPath_as_list, newvalue_as_list, 5000)

```

It didn’t throw any debug errors but it didn’t work either.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [August 31, 2019, 3:33am UTC](https://forum.inductiveautomation.com/t/how-can-i-change-an-alarm-setpoint-using-a-script-action/27911/2 "2019-08-31T03:33:08Z")

</div>

8.0 has [system.tag.configure()](https://docs.inductiveautomation.com/display/DOC80/system.tag.configure).

I found it easier to get the tag configuration, modify it, then write the configuration back.

```python
tagName = '[default]path/to/tag'

tagConfig = system.tag.getConfiguration(tagName)

tagConfig[0]['alarms'][0]['setpointA'] = newValue

system.tag.configure('', tagConfig)

```
