# Tag query event driven

**URL:** <https://forum.inductiveautomation.com/t/tag-query-event-driven/38733>\
**Category:** Ignition\
**Created:** [September 16, 2020, 6:57am UTC](https://forum.inductiveautomation.com/t/tag-query-event-driven/38733 "2020-09-16T06:57:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pick](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@pick](https://forum.inductiveautomation.com/u/pick)\
**Post date:** [September 16, 2020, 6:57am UTC](https://forum.inductiveautomation.com/t/tag-query-event-driven/38733/1 "2020-09-16T06:57:08Z")

</div>

Hello, when a tag query is configure with event driven it means that the query is fire when the event happen but which event ? When the tag is read? Could we configure this event?  
Thank for help.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 16, 2020, 12:09pm UTC](https://forum.inductiveautomation.com/t/tag-query-event-driven/38733/2 "2020-09-16T12:09:30Z")

</div>

Event driven relies on a change to some other tag referenced in your query binding. So if your query takes an integer parameter and you tie that to another tag, a change to that integer tag will trigger your query again.

---

<div class="post-metadata">

**Author:** ![pick](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@pick](https://forum.inductiveautomation.com/u/pick)\
**Post date:** [September 17, 2020, 6:40am UTC](https://forum.inductiveautomation.com/t/tag-query-event-driven/38733/3 "2020-09-17T06:40:16Z")

</div>

It work well. Thank.

---

<div class="post-metadata">

**Author:** ![hewking32](https://avatars.discourse-cdn.com/v4/letter/h/b5ac83/32.png) [@hewking32](https://forum.inductiveautomation.com/u/hewking32)\
**Post date:** [February 24, 2022, 6:18pm UTC](https://forum.inductiveautomation.com/t/tag-query-event-driven/38733/4 "2022-02-24T18:18:56Z")

</div>

@pturmel Hi again  
what about scenario when my query tag is using “select \* from table\_view”.  
How to trigger an expensive dataset query only when it is truly needed?  
I tried to add "where " statement to the end of my query to read the value of the memory tag but i dont see the dataset being refreshed ☹

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 24, 2022, 8:51pm UTC](https://forum.inductiveautomation.com/t/tag-query-event-driven/38733/5 "2022-02-24T20:51:29Z")

</div>

Don’t use a query tag. Use a simple Dataset memory tag that is written only by a script. Use any desired combinations of events to decide when to call the update script. If using Vision, use a gateway message handler to actually call the script.

---

<div class="post-metadata">

**Author:** ![hewking32](https://avatars.discourse-cdn.com/v4/letter/h/b5ac83/32.png) [@hewking32](https://forum.inductiveautomation.com/u/hewking32)\
**Post date:** [February 25, 2022, 3:18pm UTC](https://forum.inductiveautomation.com/t/tag-query-event-driven/38733/6 "2022-02-25T15:18:25Z")

</div>

thanks Phil it works beautifully

---

<div class="post-metadata">

**Author:** ![Parth\_Pandya](https://avatars.discourse-cdn.com/v4/letter/p/5f9b8f/32.png) [@Parth\_Pandya](https://forum.inductiveautomation.com/u/Parth_Pandya)\
**Post date:** [March 16, 2023, 6:31pm UTC](https://forum.inductiveautomation.com/t/tag-query-event-driven/38733/7 "2023-03-16T18:31:51Z")

</div>

where can i see that example ?
