# Get name out of an active alarm

**URL:** <https://forum.inductiveautomation.com/t/get-name-out-of-an-active-alarm/102535>\
**Category:** Educational Engagement\
**Tags:** vision, scripting\
**Created:** [February 19, 2025, 8:25am UTC](https://forum.inductiveautomation.com/t/get-name-out-of-an-active-alarm/102535 "2025-02-19T08:25:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![b.nijendijk](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@b.nijendijk](https://forum.inductiveautomation.com/u/b.nijendijk)\
**Post date:** [February 19, 2025, 8:25am UTC](https://forum.inductiveautomation.com/t/get-name-out-of-an-active-alarm/102535/1 "2025-02-19T08:25:15Z")

</div>

I am trying the build a new project. I want to create an alarm board. I have many different kind of sensors that all have different alarm. I want to be able to send a pop-up window with a background color according to the urgency of the alarm and I also want a good alarm description in this window.

Because of the huge amount of different alarms I want to create a good solution. I want to retrieve the name and description of the active alarm and put it inside two variables. That way I want to make a label where those variables are used. For example: "{AlarmName} active, {AlarmDescription}".

I still cant find out how I can get the info out of an alarm and put it in a variable. Does somebody know how to do this?

---

<div class="post-metadata">

**Author:** ![kvane](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kvane/32/22228_2.png) [@kvane](https://forum.inductiveautomation.com/u/kvane)\
**Post date:** [February 20, 2025, 6:27am UTC](https://forum.inductiveautomation.com/t/get-name-out-of-an-active-alarm/102535/2 "2025-02-20T06:27:51Z")

</div>

Alarms configured on tags have a lot of [properties](https://www.docs.inductiveautomation.com/docs/8.1/platform/tags/tag-properties/tag-alarm-properties) available, the priority is a built-in property and a description could exist in one of several different string properties on an alarm.

When alarms are active, they are available through the scripting function:

> **[system.alarm.queryStatus | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-alarm/system-alarm-queryStatus)**
>
> Queries the current state of alarms. The result is a list of alarm events, which can be queried for individual properties.

You can test with this script to try and extract the data you're looking for. There are examples at the bottom, then if you read about the returned objects from this script function you will identify how to fetch specific info you want. The returned objects are explained in this section of the UM page:

> ### Returns[​](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-alarm/system-alarm-queryStatus#returns)
> 
> **AlarmQueryResult** - The AlarmQueryResult object is a list of PyAlarmEvent objects with some additional helper methods, see [Scripting Object Reference](https://www.docs.inductiveautomation.com/docs/8.1/appendix/reference-pages/scripting-object-reference).
> 
> Additionally, each PyAlarmEvent inside of the AlarmQueryResult object has several built-in methods to extract alarm information. More details on these methods can be found on the [Scripting Object Reference](https://www.docs.inductiveautomation.com/docs/8.1/appendix/reference-pages/scripting-object-reference) page.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [February 20, 2025, 7:19am UTC](https://forum.inductiveautomation.com/t/get-name-out-of-an-active-alarm/102535/3 "2025-02-20T07:19:12Z")

</div>

Would the alarm status table not suffice for what you're after? it sounds exactly what you're describing.

fwiw, I use the alarms fields like this:  
`name`: non-contextual name of the alarm e.g. "Failed to Close"  
`label`: description and equipment label of the device e.g. "Coolant Pump [C001\_PU01]"  
`displayPath`: functional area where the device is part of e.g. "Pkg Filtration"

Then you have the ability to display different combinations of these depending on where the alarms are being shown:  
Device popups: `name` only  
Parent device popups (e.g. a tank popup that contains a temperature probe within it): `label` and `name`  
General alarm page: `displayPath` (area), `label` (device), and `name`

However I also rename these names using the translation manager, renaming "Label" to "Device" and "Display Path" to "Area"

---

<div class="post-metadata">

**Author:** ![b.nijendijk](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@b.nijendijk](https://forum.inductiveautomation.com/u/b.nijendijk)\
**Post date:** [March 4, 2025, 1:53pm UTC](https://forum.inductiveautomation.com/t/get-name-out-of-an-active-alarm/102535/4 "2025-03-04T13:53:30Z")

</div>

Thanks for the replies, but I still can't figure it out. Maybe I need to specify my problem a little further.

I have a lot of different tags with alarms. I want to display a pop-up on different screens spread around in the factory. I know that there is an alarm table available, but this is way too much info for my system. Sometimes i want to target all screens and sometime only certain screens in the range of the machine in alarm state.

Because I don't want to make a label for every different alarm I want to make 1 label with variables. Something like: f"{NameAlarm} alarm, temperature = {Temperature}"

I already figured out how to get the value of a tag and store it in a variable, but i still cant figure out how to do the same with the name of an alarm.

Can somebody help me with this? Already struggling for 2 weeks and still no progress.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [March 4, 2025, 1:58pm UTC](https://forum.inductiveautomation.com/t/get-name-out-of-an-active-alarm/102535/5 "2025-03-04T13:58:18Z")

</div>

Refer to the link @kvane gave above.

> **[Scripting Object Reference | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/reference-pages/scripting-object-reference)**
>
> This page describes several common scripting objects

You can reference the name using `getName()`, although I think `name` works as well.

---

<div class="post-metadata">

**Author:** ![b.nijendijk](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@b.nijendijk](https://forum.inductiveautomation.com/u/b.nijendijk)\
**Post date:** [March 4, 2025, 2:42pm UTC](https://forum.inductiveautomation.com/t/get-name-out-of-an-active-alarm/102535/6 "2025-03-04T14:42:33Z")

</div>

I tried this in the alarm pipeline:

def handleAlarm(event):  
name = system.alarm.getName()  
print(name)  
"[default]ActiefAlarmNaam".value = name

and I also tried an alarm active script in the tag i want to store the name in:

def alarmActive(tag, tagPath, alarmName, alarmEvent, alarmPath, missedEvents):  
naam = system.alarm.getName()  
"[default]ActiefAlarmNaam".value = naam

Still nothing is happening.

---

<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:** [March 4, 2025, 3:27pm UTC](https://forum.inductiveautomation.com/t/get-name-out-of-an-active-alarm/102535/7 "2025-03-04T15:27:32Z")

</div>

A string in jython that contains the name of a tag does not magically become a reference to that tag. Use the `system.tag.*` scripting functions to read/write/manipulate tags from jython scripts.

Also, `print` does not do what most people think when using in Ignition gateway scope. Use a named logger from `system.util.getLogger()` instead of `print`.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [March 4, 2025, 4:53pm UTC](https://forum.inductiveautomation.com/t/get-name-out-of-an-active-alarm/102535/8 "2025-03-04T16:53:39Z")

</div>

Also, please see [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831).
