# Alarm counter by associated data

**URL:** <https://forum.inductiveautomation.com/t/alarm-counter-by-associated-data/60711>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [June 13, 2022, 6:32pm UTC](https://forum.inductiveautomation.com/t/alarm-counter-by-associated-data/60711 "2022-06-13T18:32:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Israel\_Martinez\_Morr](https://avatars.discourse-cdn.com/v4/letter/i/a4c791/32.png) [@Israel\_Martinez\_Morr](https://forum.inductiveautomation.com/u/Israel_Martinez_Morr)\
**Post date:** [June 13, 2022, 6:32pm UTC](https://forum.inductiveautomation.com/t/alarm-counter-by-associated-data/60711/1 "2022-06-13T18:32:00Z")

</div>

hello, I am trying to make a counter of active alarms filtering by associated data, I have this counter by folders.

```auto
runScript("system.alert.queryAlertStatus(" +
"activeAndAcked=" + toInt({Root Container.Alarms.activeAndAcked}) + "," +
"activeAndUnacked=" + toInt({Root Container.Alarms.activeAndUnacked}) + "," +
"clearAndAcked=" + toInt({Root Container.Alarms.clearAndAcked}) + "," +
"clearAndUnacked=" + toInt({Root Container.Alarms.clearAndUnacked}) + "," +
"path='---'" + ").rowCount", 1000)

```

in the alarm status table I filtered by group, I would like to be able to join the filter and the counter

```auto
group = alarmEvent.get("Group")
    if group == "Group A":
        return True
    return False

```

Thank you

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 14, 2022, 12:19pm UTC](https://forum.inductiveautomation.com/t/alarm-counter-by-associated-data/60711/2 "2022-06-14T12:19:17Z")

</div>

Copy and paste the code, we can't see anything here.  
And make sure to enclose it in triple backquotes so that it's interpreted as code and keeps its formatting.

> ```  
> code  
> ```

That said, what version of ignition are you using ?

---

<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:** [June 14, 2022, 12:26pm UTC](https://forum.inductiveautomation.com/t/alarm-counter-by-associated-data/60711/3 "2022-06-14T12:26:02Z")

</div>

I recommend you explain what you are ultimately trying to do. If you are just wanting a count of alarms for a specific path, that is relatively easy and there are many posts on this forum already about it.

> [@Active alarm in area?](https://forum.inductiveautomation.com/t/active-alarm-in-area/41892):
>
> I would like to have a way of knowing if any PLC tag in a particular process area has an active alarm so that I can show in the HMI which areas have or do not have an active alarm. This could be used in a process overview display to show several process areas, and those with active alarms could have blinking red or something like that. I think I would have to make use of the system.alarm.queryStatus function in a Python script. If tags for each process area are in separate folders, I could us…

> [@Displaying Alarm Count](https://forum.inductiveautomation.com/t/displaying-alarm-count/15443):
>
> I am trying to display a number of alarms that are active. However, I am trying to display certain alarms. I have the alarms that I am wanting to display in a group called “Spray Status”. Is there a way to display how many alarms are active in that group?

---

<div class="post-metadata">

**Author:** ![Israel\_Martinez\_Morr](https://avatars.discourse-cdn.com/v4/letter/i/a4c791/32.png) [@Israel\_Martinez\_Morr](https://forum.inductiveautomation.com/u/Israel_Martinez_Morr)\
**Post date:** [June 15, 2022, 5:49pm UTC](https://forum.inductiveautomation.com/t/alarm-counter-by-associated-data/60711/4 "2022-06-15T17:49:54Z")

</div>

I would like to be able to unite the filter and the counter.

---

<div class="post-metadata">

**Author:** ![Israel\_Martinez\_Morr](https://avatars.discourse-cdn.com/v4/letter/i/a4c791/32.png) [@Israel\_Martinez\_Morr](https://forum.inductiveautomation.com/u/Israel_Martinez_Morr)\
**Post date:** [June 15, 2022, 5:52pm UTC](https://forum.inductiveautomation.com/t/alarm-counter-by-associated-data/60711/5 "2022-06-15T17:52:17Z")

</div>

I already updated it and I’m using version 7.8

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 16, 2022, 7:14am UTC](https://forum.inductiveautomation.com/t/alarm-counter-by-associated-data/60711/6 "2022-06-16T07:14:33Z")

</div>

That’s an old and, I believe, unsupported version. I have no idea what’s possible or not in 7.8…
