# How to Show a Button Only When an Active Alarm Occurs in Ignition

**URL:** <https://forum.inductiveautomation.com/t/how-to-show-a-button-only-when-an-active-alarm-occurs-in-ignition/71154>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [March 16, 2023, 12:18pm UTC](https://forum.inductiveautomation.com/t/how-to-show-a-button-only-when-an-active-alarm-occurs-in-ignition/71154 "2023-03-16T12:18:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Miguel\_Cimildoro](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@Miguel\_Cimildoro](https://forum.inductiveautomation.com/u/Miguel_Cimildoro)\
**Post date:** [March 16, 2023, 12:18pm UTC](https://forum.inductiveautomation.com/t/how-to-show-a-button-only-when-an-active-alarm-occurs-in-ignition/71154/1 "2023-03-16T12:18:32Z")

</div>

Hi everyone,

I'm trying to make a button visible only when there is an active alarm, and I'm using the `system.alarm.queryStatus` method for this. However, I'm having trouble getting the `Visible` property to recognize the expression. Is there another way to do this? I just want the button to be visible while there is an active alarm with a specific filter, for example:

if system.alarm.queryStatus(state=['Active'], displayPath="\*BESS\_1\_1\_1\_1 : \*"):  
event.source.visible = True  
else:  
event.source.visible = False

Best regards.

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [March 16, 2023, 12:30pm UTC](https://forum.inductiveautomation.com/t/how-to-show-a-button-only-when-an-active-alarm-occurs-in-ignition/71154/2 "2023-03-16T12:30:58Z")

</div>

What you're using seems to be a **Script** , you can test it on the console and with some prints you might be able to see if it's working, if it works on the console, then you might have a problem that the trigger you've set your script to might not be working, for example, if you placed it on a mouseClicked event and there isn't a click happening on the component.  
Anyway, try adding a expression binding to the Visible property and use the **isAlarmActive()** function.  
[https://docs.inductiveautomation.com/display/DOC81/isAlarmActive](https://docs.inductiveautomation.com/display/DOC81/isAlarmActive)  
Also, is it vision or perspective?

---

<div class="post-metadata">

**Author:** ![Miguel\_Cimildoro](https://avatars.discourse-cdn.com/v4/letter/m/53a042/32.png) [@Miguel\_Cimildoro](https://forum.inductiveautomation.com/u/Miguel_Cimildoro)\
**Post date:** [March 16, 2023, 2:07pm UTC](https://forum.inductiveautomation.com/t/how-to-show-a-button-only-when-an-active-alarm-occurs-in-ignition/71154/3 "2023-03-16T14:07:59Z")

</div>

I was actually trying to do it through a script, but what I meant to ask was if there is a way to achieve the same thing using an expression. Sorry if I didn't explain myself clearly enough earlier.

and yees it's Vision properties that I'm working on.

On the other hand, isAlarmActive is exactly what I was looking for, in fact, the isAlarmActiveFiltered() method is even more useful for me. I really appreciate your response, greetings.
