# Checking if any tag in a folder is active

**URL:** <https://forum.inductiveautomation.com/t/checking-if-any-tag-in-a-folder-is-active/58296>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 11, 2022, 2:28pm UTC](https://forum.inductiveautomation.com/t/checking-if-any-tag-in-a-folder-is-active/58296 "2022-04-11T14:28:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dean\_Walsh](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@Dean\_Walsh](https://forum.inductiveautomation.com/u/Dean_Walsh)\
**Post date:** [April 11, 2022, 2:28pm UTC](https://forum.inductiveautomation.com/t/checking-if-any-tag-in-a-folder-is-active/58296/1 "2022-04-11T14:28:22Z")

</div>

In my application i have some tags imported from kepware, i would like to check if any of the values within my alarms folder of the tags are active and to bind this to make a component visible.

(this is the method I’ve tried thinking by setting the tag path to the folder it would return the number of alarms active and could therefore say true unless 0. But it just always returns 2 for some reason.)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/9/b97a5f6ac977cecd825b48e3f76ce6e41271e2f6.png)  
I don’t know if this is even possible, any advice would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [April 11, 2022, 2:44pm UTC](https://forum.inductiveautomation.com/t/checking-if-any-tag-in-a-folder-is-active/58296/2 "2022-04-11T14:44:57Z")

</div>

Could you send a summary bit (or int) from the origin point of the alarms? That would probably be the cleanest solution. If that’s not an option, the script below will get all the first level tags of a provided root folder. This isn’t an especially efficient solution, so you should be cautious about using it. If you need to get all the tags in child folders you’ll have to write a function for recursive browsing (several examples can be found in other forum posts.)

```auto
rootPath = '[default]machineCenter/machine/control/alarms'
tags = system.tag.browse(rootPath)
values = [i['value'].value for i in tags]
print any(values)

```

---

<div class="post-metadata">

**Author:** ![Dean\_Walsh](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@Dean\_Walsh](https://forum.inductiveautomation.com/u/Dean_Walsh)\
**Post date:** [April 11, 2022, 4:28pm UTC](https://forum.inductiveautomation.com/t/checking-if-any-tag-in-a-folder-is-active/58296/3 "2022-04-11T16:28:13Z")

</div>

> [@zacht](#):
>
> ```auto
> rootPath = '[default]machineCenter/machine/control/alarms'
> tags = system.tag.browse(rootPath)
> values = [i['value'].value for i in tags]
> print any(values)
> 
> ```

Thank you zacht i took a little time to understand this concept but it has led me to the solution!
