# Checking if tag has alarms or history from system.tag.browse

**URL:** <https://forum.inductiveautomation.com/t/checking-if-tag-has-alarms-or-history-from-system-tag-browse/58002>\
**Category:** Ignition\
**Created:** [April 4, 2022, 3:25pm UTC](https://forum.inductiveautomation.com/t/checking-if-tag-has-alarms-or-history-from-system-tag-browse/58002 "2022-04-04T15:25:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 4, 2022, 3:25pm UTC](https://forum.inductiveautomation.com/t/checking-if-tag-has-alarms-or-history-from-system-tag-browse/58002/1 "2022-04-04T15:25:24Z")

</div>

EDIT: Can I check if tags have alarms and history from `system.tag.browse` results?

---

<div class="post-metadata">

**Author:** ![swolnisty](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@swolnisty](https://forum.inductiveautomation.com/u/swolnisty)\
**Post date:** [April 4, 2022, 6:59pm UTC](https://forum.inductiveautomation.com/t/checking-if-tag-has-alarms-or-history-from-system-tag-browse/58002/2 "2022-04-04T18:59:35Z")

</div>

Why not just filter the results of your tag browse function on the ‘attributes’ key? If a tag has history enabled the attributes list will contain NodeAttribute[history] and if the tag has alarms it will contain NodeAttribute[alarm].

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 4, 2022, 7:01pm UTC](https://forum.inductiveautomation.com/t/checking-if-tag-has-alarms-or-history-from-system-tag-browse/58002/3 "2022-04-04T19:01:11Z")

</div>

I thought that might have been the case… I did check them for one tag but apparently I didn’t check a tag that actually had either an alarm or history enabled. Thanks 😳

---

<div class="post-metadata">

**Author:** ![swolnisty](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@swolnisty](https://forum.inductiveautomation.com/u/swolnisty)\
**Post date:** [April 4, 2022, 7:06pm UTC](https://forum.inductiveautomation.com/t/checking-if-tag-has-alarms-or-history-from-system-tag-browse/58002/4 "2022-04-04T19:06:58Z")

</div>

Which brings up another good point; not all objects returned by system.tag.browse contain the attributes key, so it would probably be a good idea to retrieve that property using the dictionary .get() method with a fallback value defined rather than directly referencing `tag['attributes']`.
