# Exporting Alarm Status Table to CSV

**URL:** <https://forum.inductiveautomation.com/t/exporting-alarm-status-table-to-csv/17530>\
**Category:** Ignition\
**Created:** [March 28, 2018, 7:29am UTC](https://forum.inductiveautomation.com/t/exporting-alarm-status-table-to-csv/17530 "2018-03-28T07:29:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmdalisay](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@rmdalisay](https://forum.inductiveautomation.com/u/rmdalisay)\
**Post date:** [March 28, 2018, 7:29am UTC](https://forum.inductiveautomation.com/t/exporting-alarm-status-table-to-csv/17530/1 "2018-03-28T07:29:48Z")

</div>

Hi all!

Our client is requiring to export alarm logs with:

- time range filter
- display path filter
- Showing event value
- name
- active time
- clear time
- priority  
Is there a way to export alarm status table with these filters applied and these information shown? I have come across system.alarm.queryJournal. However, the info it contains are limited to eventId, source, Displaypath, eventTime, Eventstate. priority and isSystemevent only. I hope someone can advice me on the workaround or script I could use to get this working. Thank you so much in advance.

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [March 28, 2018, 10:46am UTC](https://forum.inductiveautomation.com/t/exporting-alarm-status-table-to-csv/17530/2 "2018-03-28T10:46:28Z")

</div>

It would be best to display the alarms in the table. Then the user can already preview the data.

Once you have it in the table, it’s quite simple to export it to CSV with the [`system.dataset.exportCSV` function](https://docs.inductiveautomation.com/display/DOC79/system.dataset.exportCSV)

---

<div class="post-metadata">

**Author:** ![rmdalisay](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@rmdalisay](https://forum.inductiveautomation.com/u/rmdalisay)\
**Post date:** [April 2, 2018, 12:51am UTC](https://forum.inductiveautomation.com/t/exporting-alarm-status-table-to-csv/17530/3 "2018-04-02T00:51:00Z")

</div>

Hi @Sanderd17!

Thank you for your response. I tried using systems.alarm.query.Journal to display it first in a table and to do the extract. But the information it provides are limited and does not contain all the info I need. So, I was wondering if there’s a way to show them all. Ignition support suggested it’s better to use system.alarm.queryStatus (thanks Ignition support!) I tried it but, I need to display the Name, ack time, clear time, event value columns from the Alarm status table to the table which I will use to export to csv. However, system.alarm.queryStatus only shows source, displaypath, eventtime, state and priority.

Maybe someone can enlighten me on how I can reflect these additional columns from the alarm status table to another table for csv export.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [April 2, 2018, 5:08pm UTC](https://forum.inductiveautomation.com/t/exporting-alarm-status-table-to-csv/17530/4 "2018-04-02T17:08:29Z")

</div>

You will need to examine the AlarmEvent objects. Here is a sample of how to use [system.alarm.queryStatus](https://docs.inductiveautomation.com/display/DOC79/system.alarm.queryStatus) to print some alarm information. You can modify this to put the data you need into a dataset.

[system.alarm.queryJournal](https://docs.inductiveautomation.com/display/DOC79/system.alarm.queryJournal) will be similar but each alarm event (active, cleared, acknowledged) will be separate details.

```auto
from com.inductiveautomation.ignition.common.config import BasicProperty
eventTime = BasicProperty("eventTime", BasicProperty().getType())
alarms = system.alarm.queryStatus()

for alarm in alarms:
	print "***********************",alarm.getDisplayPath(),"***********************"
	if not(alarm.getPriority() is None): 
		print "priority: " , alarm.getPriority()
	if not(alarm.getActiveData() is None): 
		print "active time: " , alarm.getActiveData().get(eventTime)
	if not(alarm.getClearedData() is None):
		print "clear time: " , alarm.getClearedData().get(eventTime)
	if not(alarm.getAckData() is None):
		print "ack time: " , alarm.getAckData().get(eventTime)

```

---

<div class="post-metadata">

**Author:** ![rmdalisay](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@rmdalisay](https://forum.inductiveautomation.com/u/rmdalisay)\
**Post date:** [April 3, 2018, 3:32am UTC](https://forum.inductiveautomation.com/t/exporting-alarm-status-table-to-csv/17530/5 "2018-04-03T03:32:02Z")

</div>

Thank you so much!  
Exactly what I was looking for.

I have no idea on how to start the script and how to properly compose script to return the list in system.alarm.queryStatus.  
I was able to put the data into a table and export it now to csv.

Thanks again!

---

<div class="post-metadata">

**Author:** ![Bastian\_Ignacio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bastian_ignacio/32/43245_2.png) [@Bastian\_Ignacio](https://forum.inductiveautomation.com/u/Bastian_Ignacio)\
**Post date:** [February 3, 2023, 6:43pm UTC](https://forum.inductiveautomation.com/t/exporting-alarm-status-table-to-csv/17530/6 "2023-02-03T18:43:55Z")

</div>

I understand that it is an old post, but I am trying to print the recognized notes without result..

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/3/63e621a8b71a005b46dbfee3155584d008988a35.png)

and i'm trying like this..

```auto
from com.inductiveautomation.ignition.common.config import BasicProperty
eventTime = BasicProperty("eventTime", BasicProperty().getType())
alarms = system.alarm.queryStatus()

for alarm in alarms:
    print "***",alarm.getDisplayPath(),"***"
    if not(alarm.getPriority() is None): 
        print "priority: " , alarm.getPriority()
    ack_notes = alarm.getAckNotes
    print "asd"
    if ack_notes is not None:
        print "ack notes: ", ack_notes

```

---

<div class="post-metadata">

**Author:** ![ethomason](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethomason/32/43338_2.png) [@ethomason](https://forum.inductiveautomation.com/u/ethomason)\
**Post date:** [February 3, 2023, 10:01pm UTC](https://forum.inductiveautomation.com/t/exporting-alarm-status-table-to-csv/17530/7 "2023-02-03T22:01:09Z")

</div>

Are you using 8.1? You were close.

```auto
from com.inductiveautomation.ignition.common.config import BasicProperty
eventTime = BasicProperty("eventTime", BasicProperty().getType())
ackNotes = BasicProperty("ackNotes", BasicProperty().getType())
alarms = system.alarm.queryStatus()

for alarm in alarms:
    print "***",alarm.getDisplayPath(),"***"
    if not(alarm.getPriority() is None): 
        print "priority: " , alarm.getPriority()
    ack_notes = alarm.getAckData().get(ackNotes)
    
    if ack_notes is not None:
        print "ack notes: ", ack_notes

```
