# \[SOLVED\] How to modify Alarm script on Navigation template to filter source

**URL:** <https://forum.inductiveautomation.com/t/solved-how-to-modify-alarm-script-on-navigation-template-to-filter-source/32008>\
**Category:** Ignition\
**Created:** [February 6, 2020, 6:11pm UTC](https://forum.inductiveautomation.com/t/solved-how-to-modify-alarm-script-on-navigation-template-to-filter-source/32008 "2020-02-06T18:11:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [February 6, 2020, 6:11pm UTC](https://forum.inductiveautomation.com/t/solved-how-to-modify-alarm-script-on-navigation-template-to-filter-source/32008/1 "2020-02-06T18:11:41Z")

</div>

Ignition provides a template for the Navigation pane on the left. There is a small box that says something like ‘X alarms’ and blinks yellow. If you dig deep enough it gets its information from a script that gathers all alarms in the gateway. Is there a way to filter this script on the source only using wildcards?

```
if({Alarm Count Label.states} = "", 

0,

toInt(runScript("len(system.alarm.queryStatus(state=[" + 
left({Alarm Count Label.states}, len({Alarm Count Label.states}) - 1) +
"]))", {Alarm Count Label.UpdateRate}))

```

)

I’ve tried inserting something like “source=_TAGPROVIDER_” after the state but I can’t quite get the syntax right and I’m not sure if the issue is syntax or I’m trying something impossible.

Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [February 6, 2020, 7:08pm UTC](https://forum.inductiveautomation.com/t/solved-how-to-modify-alarm-script-on-navigation-template-to-filter-source/32008/2 "2020-02-06T19:08:36Z")

</div>

Solution:

```
if({Alarm Count Label.states} = "", 

0,

toInt(runScript("len(system.alarm.queryStatus(state=[" + 
left({Alarm Count Label.states}, len({Alarm Count Label.states}) - 1) +
"], source=[\"*TAGPROVIDER*\"]))", {Alarm Count Label.UpdateRate}))

```

)
