# Determine if any tag in folder is in alarm

**URL:** <https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 29, 2023, 4:07pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522 "2023-08-29T16:07:15Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![EDoepke](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@EDoepke](https://forum.inductiveautomation.com/u/EDoepke)\
**Post date:** [August 29, 2023, 4:07pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/1 "2023-08-29T16:07:15Z")

</div>

Been years since I've touched Ignition. Working on big Perspective project. I need to know if there is an "easy" way to determine if any tag within a tag folder is in an alarm state. Example is a structure like "Filters/Filter1/INF\_VLV". In that folder there may be a UDT with several possible alarms, as well as individual tags that could be alarmed. Is there any sort of script/function that would return a boolean if any of the alarm states are active for just that folder? Reasoning is I want a yellow border around my screen badge, but want it to be universal to fit folders with any number of alarms rather than scripting a bunch of "or this or that or..." that has to be changed for multiple items. Any assistance greatly appreciated.

---

<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:** [August 29, 2023, 4:16pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/2 "2023-08-29T16:16:38Z")

</div>

Tags do have an `HasActive` boolean in the `Alarms` property:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/a/1a817144769d7ce5e9f413e3bb52c00721d15cd0.png)

But I'm not sure you can reach it through scripting.

Another solution would be to pass the results of a tag browse to `system.alarm.queryStatus`

---

<div class="post-metadata">

**Author:** ![CalebM](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@CalebM](https://forum.inductiveautomation.com/u/CalebM)\
**Post date:** [August 29, 2023, 4:26pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/3 "2023-08-29T16:26:24Z")

</div>

You can filter `system.alarm.queryStatus()` based on source and state. Unless I am missing something I think the it should work in your case. The following returns a list of all active alarm within the folder Pumps.

```auto
system.alarm.queryStatus(state = [2,3], source = "prov:default:/tag:Pumps/*")

```

You could then perform a check to see if it returns anything and use that to determine whether or not to show the border and badge.

---

<div class="post-metadata">

**Author:** ![CalebM](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@CalebM](https://forum.inductiveautomation.com/u/CalebM)\
**Post date:** [August 29, 2023, 4:39pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/4 "2023-08-29T16:39:07Z")

</div>

I think you could do one better with expression.

```auto
isAlarmActive("[default]Pumps/*")

```

Seems to do the same thing.

---

<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:** [August 29, 2023, 5:30pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/5 "2023-08-29T17:30:55Z")

</div>

There are some exchange resources that may be helpful, here is one:

> **[Ignition Exchange](https://inductiveautomation.com/exchange/2392/overview)**
>
> Discover, share, and download community made Ignition resources in collaboration with your organization or the Ignition community.

---

<div class="post-metadata">

**Author:** ![EDoepke](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@EDoepke](https://forum.inductiveautomation.com/u/EDoepke)\
**Post date:** [August 29, 2023, 5:36pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/6 "2023-08-29T17:36:23Z")

</div>

Thank you so much! I will give that a try.

---

<div class="post-metadata">

**Author:** ![EDoepke](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@EDoepke](https://forum.inductiveautomation.com/u/EDoepke)\
**Post date:** [September 1, 2023, 12:59pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/7 "2023-09-01T12:59:58Z")

</div>

I've tested this function successfully. Problem now is how do I make it "Dynamic". Have fullscreen view which calculates parameter "TagPath" based in a filter number (i.e. [default]Filters/Filt1). In that filter are UDT's for valves, say INF\_VLV. Have smaller view with badge for each valve that looks for parameters based on "TagPath" and appends "/INF\_VLV". Can I pass a calculated strings into the isAlarmActive script function to dynamically change the style of the badge view (like draw a red border around it). Just can't seem to figure out how to "parameterize" this without creating a new "tag" within each UDT (which would be a big hassle).  
Again, any assistance greatly appreciated.

---

<div class="post-metadata">

**Author:** ![CalebM](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@CalebM](https://forum.inductiveautomation.com/u/CalebM)\
**Post date:** [September 1, 2023, 1:17pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/8 "2023-09-01T13:17:16Z")

</div>

You should definitely be able to accomplish this. You should be able to bind to the TagPath parameter on the subviews `isAlarmActive({this.params.TagPath})` within the smaller valve view. You will probably have to add a `/*` to the end of the path that way you are checking all tags within the valve UDT for an alarm. `isAlarmActive({this.custom.TagPath+'/*'})`

---

<div class="post-metadata">

**Author:** ![EDoepke](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@EDoepke](https://forum.inductiveautomation.com/u/EDoepke)\
**Post date:** [September 1, 2023, 1:39pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/9 "2023-09-01T13:39:36Z")

</div>

Thank you. I have been trying that. Ignition is giving me grief! I am testing with a memory tag. Created a label and bound the text to "isAlarmActive({view.custom.AlarmPath})". [created custome property of AlarmPath which is TagPath " "/\*"]. If I toggle an alarm bit, the Binding Preview updates correctly (true or false). However the View label does not update until I check the binding. Toggling the bit does not change the label, but if I toggle the bit, check the binding preview and close it, the label updates.  
However, if I create a memory discrete tag bound to the isAlarmActive expression it updates in realtime.

---

<div class="post-metadata">

**Author:** ![zbinder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zbinder/32/28918_2.png) [@zbinder](https://forum.inductiveautomation.com/u/zbinder)\
**Post date:** [September 1, 2023, 1:52pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/10 "2023-09-01T13:52:45Z")

</div>

I've experienced difficulties doing what I wanted with isAlarmActive() a while ago, though I can't recall exactly what they were.

If you do decide to go the Python route, this post contains a great example of how to get more mileage out of system.alarm.queryStatus().

> [@Active alarm in area?](https://forum.inductiveautomation.com/t/active-alarm-in-area/41892/5):
>
> I use a UDT for this in Ignition that gets a summary of alarms based on where the UDT is located. UDT json is attached [Area Alarms.json](https://forum.inductiveautomation.com/uploads/short-url/qkjv7KDjjTvoyFCq6zCNnWNoXpi.json) (2.7 KB). You’ll need this script as well to summarise the alarms, put under a script library called shared.alarms: def getAlarmSummary(filterPath='\*'): if filterPath.find(']') != -1: filterPath = filterPath.split(']')[1] alarms = system.alarm.queryStatus(priority=[1,2,3,4], state=['ActiveAcked','ClearUnacked','ActiveUnacked'], path=['\*:…

---

<div class="post-metadata">

**Author:** ![CalebM](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@CalebM](https://forum.inductiveautomation.com/u/CalebM)\
**Post date:** [September 1, 2023, 2:23pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/11 "2023-09-01T14:23:23Z")

</div>

I think the issue you are facing is that `isAlarmActive()` does not poll in perspective and if you use `/*` it does not detect the tag change.  
I am not sure if this is the most elegant solution but you could spoof polling.  
`if(now(1000)>0,isAlarmActive({this.view.AlarmPath}),isAlarmActive({this.view.AlarmPath}))`  
If the alarm paths are consistent it may be easier to try and avoid using `/*` that way it refreshes on tag change.

---

<div class="post-metadata">

**Author:** ![EDoepke](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@EDoepke](https://forum.inductiveautomation.com/u/EDoepke)\
**Post date:** [September 1, 2023, 3:20pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/12 "2023-09-01T15:20:36Z")

</div>

Thank you. I figured it had something to do with polling. I may just add an expression tag to each UDT that uses the isAlarmActive([.]/\* and reference that, since that is a polled tag.  
Thanks again for your assistance!

---

<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:** [September 4, 2023, 8:01am UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/13 "2023-09-04T08:01:49Z")

</div>

I don't think that works.  
I just tried with `now(3000)` and it still triggers more than every 3 seconds.

edit: I'm a bit surprised at what I'm seeing, using `now(poll_rate)` in a binding...  
I'm kinda sure I've used `now(x)` to trigger something every x seconds before, but I can't get that to work anymore...

---

<div class="post-metadata">

**Author:** ![deon.korb](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@deon.korb](https://forum.inductiveautomation.com/u/deon.korb)\
**Post date:** [September 4, 2023, 8:39am UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/14 "2023-09-04T08:39:41Z")

</div>

You can vote on this feature:

> **[Tag Alarm Aggregation | Ignition Features and Ideas | Inductive Automation](https://inductiveautomation.canny.io/ignition-features-and-ideas/p/tag-alarm-aggregation)**
>
> Getting a summary of alarms requires computationally expensive polled system.alarm.queryStatus() functions or isAlarmActiveFiltered() expressions.

---

<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:** [September 4, 2023, 12:03pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/15 "2023-09-04T12:03:48Z")

</div>

The poll rate to `now()` is milliseconds, but only works in an event-driven context. Expression tags have many execution modes, and event driven is just one of them. (Same is true for the poll rate argument to `runScript()`.)

---

<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:** [September 4, 2023, 12:09pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/16 "2023-09-04T12:09:33Z")

</div>

I did my tests on a component custom properties, not on tags.  
But that would explain why I got different results than what I thought I'd get.

---

<div class="post-metadata">

**Author:** ![CalebM](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@CalebM](https://forum.inductiveautomation.com/u/CalebM)\
**Post date:** [September 5, 2023, 7:06pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/17 "2023-09-05T19:06:52Z")

</div>

It appeared to be working correctly for me. Maybe you had another event causing it to execute. If you leave off the `/*` it will reevaluate on tag change.

---

<div class="post-metadata">

**Author:** ![hangt.kim17](https://avatars.discourse-cdn.com/v4/letter/h/ecccb3/32.png) [@hangt.kim17](https://forum.inductiveautomation.com/u/hangt.kim17)\
**Post date:** [February 2, 2026, 9:07pm UTC](https://forum.inductiveautomation.com/t/determine-if-any-tag-in-folder-is-in-alarm/78522/18 "2026-02-02T21:07:51Z")

</div>

> [@EDoepke](#):
>
> w label does not update until I check the binding. Toggling the bit does not change the label, but if I toggle the bit, check the binding preview and close it, the label updates.  
> However, if I create a memory discrete tag bound to the isAlarm

I seem to be having an interesting issue with the /\* function. Based on the from the test folder I have, it seems my “checkfolderstatus'“ tag only reflects the on tag changed status of the folder. For example, “Alarm 1” is true = “check” is true. “Alarm 2” is true = “check” is true. However, _just_ setting “Alarm 1” false causes “check” to be false. Despite “Alarm 2” still being true. Any advice /guidance?
