# Get Acknowledgement Notes

**URL:** <https://forum.inductiveautomation.com/t/get-acknowledgement-notes/65249>\
**Category:** Ignition\
**Tags:** ignition81, perspective, scripting\
**Created:** [October 14, 2022, 8:09pm UTC](https://forum.inductiveautomation.com/t/get-acknowledgement-notes/65249 "2022-10-14T20:09:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![alainia.spencer](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@alainia.spencer](https://forum.inductiveautomation.com/u/alainia.spencer)\
**Post date:** [October 14, 2022, 8:09pm UTC](https://forum.inductiveautomation.com/t/get-acknowledgement-notes/65249/1 "2022-10-14T20:09:08Z")

</div>

Is there a way to get the Acknowledgement Notes from when a user enters in a note and acknowledges an alarm?

I am using the system.alarm.acknowlegement function to ACK alarms. This seems to work fine, however, if I use the system.alarm.queryStatus to get the information for this alarm, I can't seem to find the note information. I can see the ACK note within the Alarm details section of the Alarm Status table so I know that it's getting set correctly.

Anyone else have this issue? Thoughts or suggestions on other ways to get this note information via script?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/5/354754f6b4d8f852b699fe8063369eb92b91682a.png)

---

<div class="post-metadata">

**Author:** ![schenk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@schenk](https://forum.inductiveautomation.com/u/schenk)\
**Post date:** [October 15, 2022, 12:03am UTC](https://forum.inductiveautomation.com/t/get-acknowledgement-notes/65249/2 "2022-10-15T00:03:28Z")

</div>

The `system.alarm.queryStatus()` function returns a list of alarm event objects. The available methods to use are listed in the docs here - [Scripting Object Reference - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Scripting+Object+Reference)

You can iterate through the alarms and get the notes using something like this

```auto
for alarm in system.alarm.queryStatus(path=path):
	print alarm.notes

```

---

<div class="post-metadata">

**Author:** ![alainia.spencer](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@alainia.spencer](https://forum.inductiveautomation.com/u/alainia.spencer)\
**Post date:** [October 15, 2022, 12:36pm UTC](https://forum.inductiveautomation.com/t/get-acknowledgement-notes/65249/3 "2022-10-15T12:36:15Z")

</div>

That is the function I am using to view the notes. I tried printing out the event.getNotes however nothing is returned

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 15, 2022, 4:20pm UTC](https://forum.inductiveautomation.com/t/get-acknowledgement-notes/65249/4 "2022-10-15T16:20:54Z")

</div>

Show your code with `.getNotes()`.

---

<div class="post-metadata">

**Author:** ![alainia.spencer](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@alainia.spencer](https://forum.inductiveautomation.com/u/alainia.spencer)\
**Post date:** [October 17, 2022, 1:34pm UTC](https://forum.inductiveautomation.com/t/get-acknowledgement-notes/65249/5 "2022-10-17T13:34:39Z")

</div>

Here is the code that I'm using

def getAlarmEvents(path):

```
# Create instances list.
instances = []
user = "system"
# Get the alarm events between startDate and endDate.
alarmEvents = system.alarm.queryStatus(source='*' + path + '*',state=['ActiveUnacked', 'ActiveAcked'])	
	
# Define map to display more user-friendly text that
# denotes the type of alarm event.
eventMap = {'Active, Unacknowledged': 'Alarm Active UnAck', 'Active, Acknowledged': 'Alarm Active Ack', 'Active': 'Alarm Active'}
	
# Get event type, event time, and other alarm event
# properties to create the instance, and append the
# instance to the instances list.

for alarmEvent in alarmEvents:
	event = eventMap[str(alarmEvent.getState())]
	eventId = alarmEvent.getId()
	note = alarmEvent.getNotes()	
		
	if alarmEvent.activeData:
		for item in alarmEvent.activeData:
			
			if str(item.getProperty()) == 'eventTime':
				datetime = item.getValue()	
			if str(item.getProperty()) == 'ackUser':
				user = item.getValue()	
			if str(item.getProperty()) == 'label':
				label = item.getValue()

```

---

<div class="post-metadata">

**Author:** ![alainia.spencer](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@alainia.spencer](https://forum.inductiveautomation.com/u/alainia.spencer)\
**Post date:** [October 17, 2022, 1:52pm UTC](https://forum.inductiveautomation.com/t/get-acknowledgement-notes/65249/6 "2022-10-17T13:52:46Z")

</div>

I did see the note listed in the alarm banner, I'm just having problems retrieving it via script.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/f/dff511515678855af453351f8245dd69b976a6df.png)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 17, 2022, 5:08pm UTC](https://forum.inductiveautomation.com/t/get-acknowledgement-notes/65249/7 "2022-10-17T17:08:17Z")

</div>

I was finally able to do this with some help from one of the Devs. I couldn't find the documentation for dealing with the EventData object returned from `getAckData()`, but this is what the Dev suggested and I've confirmed it works. You'll want to re-write the logic for your approach.

```auto
from com.inductiveautomation.ignition.common.alarming.config import CommonAlarmProperties

queryResult = system.alarm.queryStatus(path="*"+path+"*",state=['ActiveAcked'])
notes = queryResult[0].getAckData().get(CommonAlarmProperties.AckNotes)
system.perspective.print(str(notes))

```

---

<div class="post-metadata">

**Author:** ![alainia.spencer](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@alainia.spencer](https://forum.inductiveautomation.com/u/alainia.spencer)\
**Post date:** [October 17, 2022, 6:09pm UTC](https://forum.inductiveautomation.com/t/get-acknowledgement-notes/65249/8 "2022-10-17T18:09:11Z")

</div>

> [@cmallonee](#):
>
> `notes = queryResult[0].getAckData().get(CommonAlarmProperties.AckNotes)`

This works great, thank you very much!!
