# UDT Query Tag Not Updating

**URL:** <https://forum.inductiveautomation.com/t/udt-query-tag-not-updating/54205>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [December 16, 2021, 4:48pm UTC](https://forum.inductiveautomation.com/t/udt-query-tag-not-updating/54205 "2021-12-16T16:48:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 16, 2021, 4:48pm UTC](https://forum.inductiveautomation.com/t/udt-query-tag-not-updating/54205/1 "2021-12-16T16:48:01Z")

</div>

I have a UDT instance that has a query tag set to a Leased 5 second execution rate. When I imported them in from v7.9 they were errored out from missing parameter quotes. I fixed the errors and the correct numbers were returned. Now they won’t update like the query isn’t being run. I have the execution mode set to tag group, but I tried event driven as well with no luck. I’m new to v8.1, anything I’m missing?

---

<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:** [December 16, 2021, 4:54pm UTC](https://forum.inductiveautomation.com/t/udt-query-tag-not-updating/54205/2 "2021-12-16T16:54:00Z")

</div>

Do you have anything using that query tag (in a binding)? If not, it won’t be leased. (In v7.9, the tag browser itself would establish a lease, but not in 8+.)

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 16, 2021, 5:03pm UTC](https://forum.inductiveautomation.com/t/udt-query-tag-not-updating/54205/3 "2021-12-16T17:03:55Z")

</div>

Yes, it is has an indirect binding to a label in the project I have open in the designer. I had a client open using it too.

---

<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:** [December 16, 2021, 5:11pm UTC](https://forum.inductiveautomation.com/t/udt-query-tag-not-updating/54205/4 "2021-12-16T17:11:01Z")

</div>

Try changing it to a direct tag group, just to see if it is a leasing bug.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 16, 2021, 5:22pm UTC](https://forum.inductiveautomation.com/t/udt-query-tag-not-updating/54205/5 "2021-12-16T17:22:25Z")

</div>

If I change it to `Default` or a to a fixed rate like every 5 seconds it works. If I try to use it as a leased tag, at 0ms rate, 5000ms leased rate for example, it never updates.

edit:  
I am using v8.1 in trial mode, not sure if that is affecting it.

---

<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:** [December 16, 2021, 5:34pm UTC](https://forum.inductiveautomation.com/t/udt-query-tag-not-updating/54205/6 "2021-12-16T17:34:52Z")

</div>

No, sounds like a bug.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 16, 2021, 6:55pm UTC](https://forum.inductiveautomation.com/t/udt-query-tag-not-updating/54205/7 "2021-12-16T18:55:48Z")

</div>

What is the correct/best way to make my query tags in the UDT event driven by a memory tag in the same UDT. A tag change script that runs the query and writes to those tags, or is there a better answer than I’m unaware of?

---

<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:** [December 16, 2021, 7:05pm UTC](https://forum.inductiveautomation.com/t/udt-query-tag-not-updating/54205/8 "2021-12-16T19:05:46Z")

</div>

That’s probably it. Consider an event drive tag group, where changes in a query parameter drive execution.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 16, 2021, 9:11pm UTC](https://forum.inductiveautomation.com/t/udt-query-tag-not-updating/54205/9 "2021-12-16T21:11:34Z")

</div>

Event driven execution worked best I think. The only problem was that the query I was using didn’t take the driving tag (serial) as a parameter for the query, so I added this to the query to make it fire when changed. Is this a bad idea?

```auto
...
where cutter = '{[.]Cutter}' 
      and '{[.]Serial}' = '{[.]Serial}'
```

---

<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:** [December 16, 2021, 10:13pm UTC](https://forum.inductiveautomation.com/t/udt-query-tag-not-updating/54205/10 "2021-12-16T22:13:00Z")

</div>

Not a bad idea.
