# Incorrect value when passing UDT value to template

**URL:** <https://forum.inductiveautomation.com/t/incorrect-value-when-passing-udt-value-to-template/42859>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [February 2, 2021, 2:24am UTC](https://forum.inductiveautomation.com/t/incorrect-value-when-passing-udt-value-to-template/42859 "2021-02-02T02:24:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![richard.d.white](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@richard.d.white](https://forum.inductiveautomation.com/u/richard.d.white)\
**Post date:** [February 2, 2021, 2:24am UTC](https://forum.inductiveautomation.com/t/incorrect-value-when-passing-udt-value-to-template/42859/1 "2021-02-02T02:24:42Z")

</div>

I hope someone can provide some guidance here! I have occasionally seen this issue in other areas of my project but I think this can be described unambiguously:

I have a UDT with a boolean subtag. The entire UDT is passed to a template in Vision, and this boolean subtag is tied directly to the Visible property of the template. Therefore the template should only be visible when the tag is True.

The problem I’m having is that the value of this tag is clearly not reaching the template reliably. When I run the client I’ll have all of the templates visible on my screen even though the boolean tags are False. If I manually toggle these tags then the template appears/disappears as I would expect.

Can someone please advise how to correct this? Could this have something to do with cached values or something similar? Is there a way to be sure that parameters are properly passed to a template each time?

BTW I did experiment with the system.util.invokeLater function but this yielded the same results.

Thanks!

---

<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:** [February 2, 2021, 3:19am UTC](https://forum.inductiveautomation.com/t/incorrect-value-when-passing-udt-value-to-template/42859/2 "2021-02-02T03:19:51Z")

</div>

Sounds like a bug, but I personally would never use a UDT type parameter. I would always pass in the path to the UDT into the template (I split these and pass in the DeviceParentPath and DeviceName, then combine into DeviceTagPath in the template). Then just indirectly bind using the DeviceTagPath

> [@To UDT or not to UDT. That is the question](http://forum.inductiveautomation.com/t/to-udt-or-not-to-udt-that-is-the-question/32703/15):
>
> at a glance, it’s not possible to see by looking at a component’s properties which UDT instance has been bound to a UDT type property. E.g. in the screenshot below, I have no idea which Tower UDT is bound, I have to click on the binding to find out. It’s also far slower to populate template parameters than simply modifying a parameter string value. I tend to use 2 parameters: DeviceParentPath and DeviceName, then combine these together in an internal parameter DeviceTagPath, which also aids in…

---

<div class="post-metadata">

**Author:** ![richard.d.white](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@richard.d.white](https://forum.inductiveautomation.com/u/richard.d.white)\
**Post date:** [February 2, 2021, 6:06pm UTC](https://forum.inductiveautomation.com/t/incorrect-value-when-passing-udt-value-to-template/42859/3 "2021-02-02T18:06:18Z")

</div>

Excellent suggestion - Your advice makes perfect sense. Apart from a possible bug that I’m dealing with, your method just simply sounds like an overall better way of doing things in general. Thank you!
