# Function Binding - Alarm Status

**URL:** <https://forum.inductiveautomation.com/t/function-binding-alarm-status/34664>\
**Category:** Ignition\
**Created:** [May 12, 2020, 5:29pm UTC](https://forum.inductiveautomation.com/t/function-binding-alarm-status/34664 "2020-05-12T17:29:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cshoopman](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@cshoopman](https://forum.inductiveautomation.com/u/cshoopman)\
**Post date:** [May 12, 2020, 5:29pm UTC](https://forum.inductiveautomation.com/t/function-binding-alarm-status/34664/1 "2020-05-12T17:29:03Z")

</div>

I am using Vision 8.0.12 and I was hoping to modify/alter the Alarm Status Table. I looked around and saw it suggested to use a Table with the Function Binding of Alarm Status. It yields 6 columns (EventId, Source, DisplayPath, EventTime, State, Priority). Is there a way to further modify this? There are a lot more columns possible in the Alarm Status Table, but it’s not possible to change the names of the columns.

---

<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:** [May 12, 2020, 5:33pm UTC](https://forum.inductiveautomation.com/t/function-binding-alarm-status/34664/2 "2020-05-12T17:33:12Z")

</div>

The next step up from the function binding is manually issuing [`system.alarm.queryStatus()`](https://docs.inductiveautomation.com/display/DOC80/system.alarm.queryStatus) - it has the same six columns in the basic dataset returned, but the `AlarmQueryResults` object can also be examined to pull in more information.

---

<div class="post-metadata">

**Author:** ![cshoopman](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@cshoopman](https://forum.inductiveautomation.com/u/cshoopman)\
**Post date:** [May 13, 2020, 2:41am UTC](https://forum.inductiveautomation.com/t/function-binding-alarm-status/34664/3 "2020-05-13T02:41:00Z")

</div>

How do I use that? I found it in the javadoc, but honestly I have no idea what I’m looking at with the javadoc. Is this the right path?

```auto
state = ["ActiveUnacked", "ActiveAcked", "ClearUnacked", "ClearAcked"]
results = system.alarm.queryStatus(state = state)
table = event.source.parent.getComponent("Table 1")
test = []
for item in results:
	IDstr = str(item.getId())
	test.append(results.getEvent(IDstr))
print test

```

I am not sure how to get that in the Table, I end up getting errors.

---

<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:** [May 13, 2020, 3:23pm UTC](https://forum.inductiveautomation.com/t/function-binding-alarm-status/34664/4 "2020-05-13T15:23:32Z")

</div>

Should be something like this. Disclaimer; untested:

```python
from collections import defaultdict

state = ["ActiveUnacked", "ActiveAcked", "ClearUnacked", "ClearAcked"]
results = system.alarm.queryStatus(state = state)
table = event.source.parent.getComponent("Table 1")

ds = results.getDataset() # gets the same columns that the function binding returns

data = defaultdict(list)
for alarmEvent in results:
	data["notes"].append(alarmEvent.getNotes())
	data["name"].append(alarmEvent.getName())

for column, values in data.items():
	ds = system.dataset.addColumn(ds, ds.columnCount, values, column, basestring)

table.data = ds

```
