# Working with alarms generated by tags within a certain folder

**URL:** <https://forum.inductiveautomation.com/t/working-with-alarms-generated-by-tags-within-a-certain-folder/58445>\
**Category:** Ignition\
**Created:** [April 14, 2022, 1:24am UTC](https://forum.inductiveautomation.com/t/working-with-alarms-generated-by-tags-within-a-certain-folder/58445 "2022-04-14T01:24:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASF](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ASF](https://forum.inductiveautomation.com/u/ASF)\
**Post date:** [April 14, 2022, 1:24am UTC](https://forum.inductiveautomation.com/t/working-with-alarms-generated-by-tags-within-a-certain-folder/58445/1 "2022-04-14T01:24:52Z")

</div>

I have my tags organised into various folders according to plant area.

Is there any way of:  
(a) counting how many alarms are e.g. active and acknowledged, relating only to tags contained in a certain folder  
(b) determining what the highest priority alarm from that group of alarms is  
(c) displaying an alarm table filtered to only show these alarms  
What I want to ultimately do is highlight certain area overview icons based on alarms specifically related to that area.

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [April 14, 2022, 2:15am UTC](https://forum.inductiveautomation.com/t/working-with-alarms-generated-by-tags-within-a-certain-folder/58445/2 "2022-04-14T02:15:00Z")

</div>

You want `system.alarm.queryStatus` for this.  
(a) `len(system.alarm.queryStatus(source=["*:/tag:folder*"],state=['ActiveAcked']))`

You can get the alarm priorities but they are going to be “Low”, “High” etc. You would need to iterate through and determine the highest, i don’t have example code for that.

The filters on the alarm status table should be able to do what you want, though you may need build your filter string dynamically with scripting.

---

<div class="post-metadata">

**Author:** ![ASF](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@ASF](https://forum.inductiveautomation.com/u/ASF)\
**Post date:** [April 14, 2022, 2:28am UTC](https://forum.inductiveautomation.com/t/working-with-alarms-generated-by-tags-within-a-certain-folder/58445/3 "2022-04-14T02:28:21Z")

</div>

Excellent, I can work out the scripting for extrapolating the highest alarm priority from there. Just needed the starting point of how to get the alarm data from a specific folder. Looks like the `source` parameter in `system.alarm.queryStatus` function is just what I need. Thanks!

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [April 14, 2022, 2:29am UTC](https://forum.inductiveautomation.com/t/working-with-alarms-generated-by-tags-within-a-certain-folder/58445/4 "2022-04-14T02:29:08Z")

</div>

Another way to do it would be using the group property, but the source works just fine also.

Edit:  
Actually disregard, i am not sure the group is what i think it is.
