# Perspective Alarm Status Table - Scripting Functions

**URL:** <https://forum.inductiveautomation.com/t/perspective-alarm-status-table-scripting-functions/32543>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 24, 2020, 5:00pm UTC](https://forum.inductiveautomation.com/t/perspective-alarm-status-table-scripting-functions/32543 "2020-02-24T17:00:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaspinall](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jaspinall](https://forum.inductiveautomation.com/u/jaspinall)\
**Post date:** [February 24, 2020, 5:00pm UTC](https://forum.inductiveautomation.com/t/perspective-alarm-status-table-scripting-functions/32543/1 "2020-02-24T17:00:27Z")

</div>

Hello There:

I am just wondering if there are any exposed scripting functions for Perspective’s Alarm Status Table. We would like to add a “Acknowledge All” button to the view in which our alarm status table resides on - however I am not seeing any scripting functions in the documentation. Hoping someone could point me in the right direction on where I could find these.

Many Thanks

---

<div class="post-metadata">

**Author:** ![rbabcock](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rbabcock/32/13425_2.png) [@rbabcock](https://forum.inductiveautomation.com/u/rbabcock)\
**Post date:** [February 24, 2020, 8:15pm UTC](https://forum.inductiveautomation.com/t/perspective-alarm-status-table-scripting-functions/32543/2 "2020-02-24T20:15:33Z")

</div>

Here’s what I came up with using these manual pages:  
[https://docs.inductiveautomation.com/display/DOC80/system.alarm.acknowledge](https://docs.inductiveautomation.com/display/DOC80/system.alarm.acknowledge)  
[https://docs.inductiveautomation.com/display/DOC80/system.alarm.queryStatus](https://docs.inductiveautomation.com/display/DOC80/system.alarm.queryStatus)

```auto
def runAction(self, event):
	"""
	This event is fired when the 'action' of the component occurs.

	Arguments:
		self: A reference to the component that is invoking this function.
		event: An empty event object.
	"""
	#Alarm states to be cleared
	state = ["ActiveUnacked", "ClearUnacked"]
	#Create Dataset containing alarms in desired state
	result = system.alarm.queryStatus(state = state).getDataset()
	#Convert to python dataset
	alarmDataset = system.dataset.toPyDataSet(result)
	alarmNames = []
	#Iterate over dataset to get a list of alarm names
	for x in alarmDataset:
		alarmNames.append(x[0])
    #pass alarm name list, comment, username
	system.alarm.acknowledge(alarmNames, "Batch Ack", "Admin")

```

This goes in the Event Script on your button.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 24, 2020, 8:18pm UTC](https://forum.inductiveautomation.com/t/perspective-alarm-status-table-scripting-functions/32543/3 "2020-02-24T20:18:12Z")

</div>

> [@jaspinall](#):
>
> I am just wondering if there are any exposed scripting functions for Perspective’s Alarm Status Table.

Not currently, no, although those would make great feature requests on [ideas.inductiveautomation.com](http://ideas.inductiveautomation.com) 🙂
