# Activating an alarm when a query tag doesn't return data

**URL:** <https://forum.inductiveautomation.com/t/activating-an-alarm-when-a-query-tag-doesnt-return-data/116158>\
**Category:** Ignition\
**Tags:** vision, ignition81\
**Created:** [June 25, 2026, 3:39pm UTC](https://forum.inductiveautomation.com/t/activating-an-alarm-when-a-query-tag-doesnt-return-data/116158 "2026-06-25T15:39:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SOPerator](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@SOPerator](https://forum.inductiveautomation.com/u/SOPerator)\
**Post date:** [June 25, 2026, 3:39pm UTC](https://forum.inductiveautomation.com/t/activating-an-alarm-when-a-query-tag-doesnt-return-data/116158/1 "2026-06-25T15:39:17Z")

</div>

I current have two tags: a query tag that returns either an empty dataset or one row with 8 columns, and a boolean expression tag that has the expression isNull(myQueryTag). I'd like to be able to use the expression tag and have an alarm on it so that when isNull returns 0, the alarm triggers. However, I think that the problem I'm running into is that when the query tag executes, it never actually returns NULL even if the dataset is empty, an empty dataset may be different than NULL as right now the query tag is showing Dataset[0R x 8C]. How can I adjust this to work better? Is there a different expression function I could use instead of isNull, or do I need to adjust the query tag?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [June 25, 2026, 3:43pm UTC](https://forum.inductiveautomation.com/t/activating-an-alarm-when-a-query-tag-doesnt-return-data/116158/2 "2026-06-25T15:43:32Z")

</div>

`len(myQueryTag) = 0` should work to alarm when the query returns no rows.

> [@SOPerator](#):
>
> empty dataset may be different than NULL

Correct, they are different.

I think you would only ever get `Null` back from a scalar query, but since you are expecting multiple rows you can't use that type of query.

> **[len | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/logic/len)**
>
> Returns the length of the argument, which may be a string or a dataset.
