# Perspective Alarm Status Table Selecting/Deselecting Alarms via Script

**URL:** <https://forum.inductiveautomation.com/t/perspective-alarm-status-table-selecting-deselecting-alarms-via-script/73408>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [May 8, 2023, 3:01pm UTC](https://forum.inductiveautomation.com/t/perspective-alarm-status-table-selecting-deselecting-alarms-via-script/73408 "2023-05-08T15:01:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ethan\_Caplea](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@Ethan\_Caplea](https://forum.inductiveautomation.com/u/Ethan_Caplea)\
**Post date:** [May 8, 2023, 3:01pm UTC](https://forum.inductiveautomation.com/t/perspective-alarm-status-table-selecting-deselecting-alarms-via-script/73408/1 "2023-05-08T15:01:27Z")

</div>

I would like to prevent some alarms from even being able to be selected in an AlarmStatusTable so I have an on-click event script on the table where I check for a bad alarm in the array of actively selected alarms and remove it from the selection with:

```auto
del self.props.get('selection').get('active').get('data')[-1]

```

This correctly removes the most recently selected alarm (will always remove bad alarms and keep all selected good alarms) as shown in the empty "data" array:  
 ![AlarmStatusTable_EmptySelectedArray](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/4/54acac0c9969c6073c56c6f3b47888f9c02737f2.png)

The problem is that the table doesn't seem to present the bad alarm as unselected in the table. It still has the checkmark and can still be acknowledged:  
 ![AlarmStatusTable_AlarmSelected](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/b/7b610a8bc744295fad07f80c848f6c14fd120ace.png)

The alarm does sometimes correctly unselect but very inconsistently.  
It seems that I'm unselecting an alarm incorrectly and that there is a better way to do this.

---

<div class="post-metadata">

**Author:** ![arsalan.junaid](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/arsalan.junaid/32/48885_2.png) [@arsalan.junaid](https://forum.inductiveautomation.com/u/arsalan.junaid)\
**Post date:** [June 16, 2023, 7:10am UTC](https://forum.inductiveautomation.com/t/perspective-alarm-status-table-selecting-deselecting-alarms-via-script/73408/2 "2023-06-16T07:10:20Z")

</div>

Any update on this? Did you manage to figure out how to do this?

I am also trying to acknowledge the selected alarms on an "Alarm Status Table" using a button.

---

<div class="post-metadata">

**Author:** ![Ethan\_Caplea](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@Ethan\_Caplea](https://forum.inductiveautomation.com/u/Ethan_Caplea)\
**Post date:** [June 16, 2023, 12:28pm UTC](https://forum.inductiveautomation.com/t/perspective-alarm-status-table-selecting-deselecting-alarms-via-script/73408/3 "2023-06-16T12:28:09Z")

</div>

Yes actually, though it feels like a bad work around. I noticed that when alarm journal filters are changed, all alarms are deselected so I currently have a script that quickly changes the filter settings (then changed back to what the user is filtering on) when they try to acknowledge an alarm they don't have permissions for.

Regarding your acknowledge via button question, you can get the alarmID of all selected alarms and use system.alarm.acknowledge.  
[More about system.alarm.acknowledge here](https://scada1.icontrolservices.com/main/system/help/system.alarm.acknowledge.html#:~:text=system.alarm.acknowledge%20Description%20Acknowledges%20any%20number%20of%20alarms%2C%20specified,by%20the%20logged%20in%20user%20making%20the%20call.)

---

<div class="post-metadata">

**Author:** ![arsalan.junaid](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/arsalan.junaid/32/48885_2.png) [@arsalan.junaid](https://forum.inductiveautomation.com/u/arsalan.junaid)\
**Post date:** [June 16, 2023, 1:46pm UTC](https://forum.inductiveautomation.com/t/perspective-alarm-status-table-selecting-deselecting-alarms-via-script/73408/4 "2023-06-16T13:46:54Z")

</div>

Hi @Ethan_Caplea thanks for your response. A question. How do find all the selected alarms using script?  
A sample script woule be great.

Thanks

---

<div class="post-metadata">

**Author:** ![Ethan\_Caplea](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@Ethan\_Caplea](https://forum.inductiveautomation.com/u/Ethan_Caplea)\
**Post date:** [June 16, 2023, 2:14pm UTC](https://forum.inductiveautomation.com/t/perspective-alarm-status-table-selecting-deselecting-alarms-via-script/73408/5 "2023-06-16T14:14:33Z")

</div>

I don't currently have access to the environment but everything I've used was found in Ignition documentation.  
[Ignition Perspective Alarm Status Tables](https://docs.inductiveautomation.com/display/DOC81/Perspective+-+Alarm+Status+Table)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/3/63a71a38635f806e7771a5e15d576a9d2d995dae.png)  
This section here ^ is what I use to get the active alarm data. The data array contains UUIDs (which is what you would pass into the system.alarms.acknowledge function) and other useful information.

\*Note that it is read-only, I was originally trying to change something in there and wasn't sure why it wasn't working until I saw that.

---

<div class="post-metadata">

**Author:** ![arsalan.junaid](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/arsalan.junaid/32/48885_2.png) [@arsalan.junaid](https://forum.inductiveautomation.com/u/arsalan.junaid)\
**Post date:** [June 19, 2023, 5:58am UTC](https://forum.inductiveautomation.com/t/perspective-alarm-status-table-selecting-deselecting-alarms-via-script/73408/6 "2023-06-19T05:58:38Z")

</div>

> [@Ethan\_Caplea](#):
>
> Note that it is read-only, I was originally trying to change something in there and wasn't sure why it wasn't working until I saw that.

Finally got this working with the following code.

```auto
	data = self.parent.parent.getChild("AlarmStatusTable").props.selection.active.data
	rowCount = len(data)
	
	if rowCount > 0 :
		uuids = []
		for r in range(0, rowCount):
			uuids.append(str(data[r].eventId))
		
		system.alarm.acknowledge(uuids, None, None)

```

---

<div class="post-metadata">

**Author:** ![GregCavazos](https://avatars.discourse-cdn.com/v4/letter/g/ee7513/32.png) [@GregCavazos](https://forum.inductiveautomation.com/u/GregCavazos)\
**Post date:** [November 21, 2023, 9:47pm UTC](https://forum.inductiveautomation.com/t/perspective-alarm-status-table-selecting-deselecting-alarms-via-script/73408/7 "2023-11-21T21:47:32Z")

</div>

How do you clear the selection?

I tried to use the one on the original post, but I cannot figure out how to make it work. As a test I tried a script and run as noted by the OP.

```auto
del self.props.get('selection').get('active').get('data')[-1]

```

I also tried manually seting the property to `[]` or 0, but If I am not mistaken thats readonly.

```auto
self.props.selection.active.data = []

```
