# Issues with Vision Template Binding

**URL:** <https://forum.inductiveautomation.com/t/issues-with-vision-template-binding/99443>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [December 4, 2024, 7:35pm UTC](https://forum.inductiveautomation.com/t/issues-with-vision-template-binding/99443 "2024-12-04T19:35:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brittany\_Villasenor](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@Brittany\_Villasenor](https://forum.inductiveautomation.com/u/Brittany_Villasenor)\
**Post date:** [December 4, 2024, 7:35pm UTC](https://forum.inductiveautomation.com/t/issues-with-vision-template-binding/99443/1 "2024-12-04T19:35:26Z")

</div>

I used this expression bound to a multistate indicator's state property within my template:  
getBit({PointIO.Data::Data},toInt({PointIO.0.name},0))

I'm trying to do something similar with a different template, and it works as far as allowing me to submit the expression without an error popping up, but there is a fx overlay on the multistate indicator. Here is the expression:

**getBit(toInt("PointIO\_IOLink2." + {PointIO\_IOLink2.Ch0.name} + "Data::Data"), toInt({PointIO\_IOLink2.Ch0.Ch 0 to 7.0.name}))**

Does anyone know how I can adjust this to work properly?  
Please let me know if additional information is needed 🙂

---

<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:** [December 4, 2024, 8:04pm UTC](https://forum.inductiveautomation.com/t/issues-with-vision-template-binding/99443/2 "2024-12-04T20:04:11Z")

</div>

First, please see [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831).

~~Second, `toInt` requires a fallback value, you have not provided such to either call in the second expression that you posted.~~ This is an optional parameter.

You look like you are attempting to create an indirect tag path, is this correct? If so you are approaching it incorrectly, your current expression is just creating a string of `PointIO_IOLink2.SomeValueHereData::Data` instead of pointing to a tag.  
Instead, create a custom internal property on the template and apply an indirect tag binding to that.

> **[Indirect Tag Bindings in Vision | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/vision/binding-types-in-vision/indirect-tag-bindings-in-vision)**
>
> Binding Properties to a Dynamic Set of Tags

Configure the tag binding path to be `PointIO_IOLink2.{1}Data::Data`, and configure the `{1}` to be assigned a value of `{PointIO_IOLink2.Ch0.name}`.

From there, your binding would be adjusted to

```python
getBit(
	toInt({template.customInternalProperty}),
	toInt({PointIO_IOLink2.Ch0.Ch 0 to 7.0.name})
)

```

Additionally, if these are indeed tag paths, `.` is not a valid character for tag names.

> **[Tags | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/platform/tags#tag-naming)**
>
> What Is a Tag?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [December 4, 2024, 8:10pm UTC](https://forum.inductiveautomation.com/t/issues-with-vision-template-binding/99443/3 "2024-12-04T20:10:00Z")

</div>

> [@ryan.white](#):
>
> Second, `toInt` requires a fallback value, you have not provided such to either call in the second expression that you posted.

The failover value is optional.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 4, 2024, 11:01pm UTC](https://forum.inductiveautomation.com/t/issues-with-vision-template-binding/99443/4 "2024-12-04T23:01:07Z")

</div>

Consider also skipping out entirely on 'custom' type properties (direct bindings to UDTs) in Vision. They're a bit of a performance footgun, because a UDT type binding brings in _everything in the UDT_ at whatever the binding's subscription rate is. If you make string-type parameters for your templates, it's trivial to bring in an indirect path via an expression doing the concatenation, and then use indirect tag bindings for all the _specific_ subpaths you care about within the template.

---

<div class="post-metadata">

**Author:** ![Brittany\_Villasenor](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@Brittany\_Villasenor](https://forum.inductiveautomation.com/u/Brittany_Villasenor)\
**Post date:** [December 5, 2024, 5:55pm UTC](https://forum.inductiveautomation.com/t/issues-with-vision-template-binding/99443/5 "2024-12-05T17:55:30Z")

</div>

Noted on posting code appropriately in this forum.

I'm trying to create a path to this Data UDT property:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/1/11620bd24199ad664d33bae90671387aef2f1d34.png)

I'd like the part "Ch0" to be named depending on the container name:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/a/9a616560bab6582a251e870b6706196151755dff.png)

That way, the names will update the path dynamically.

I tried your solution, but wouldn't I have to make multiple internal custom properties for this to work or it'll always go back to Ch0?

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [December 5, 2024, 6:38pm UTC](https://forum.inductiveautomation.com/t/issues-with-vision-template-binding/99443/6 "2024-12-05T18:38:18Z")

</div>

If i understood it correctly, in your binding you try to use CH0.name as a parameter, right?

> [@Brittany\_Villasenor](#):
>
> - {PointIO\_IOLink2.Ch0.name}

I think the problem might be: How can you use CH0.name as a binding if you plan on changing its name and therefore its path?  
Maybe add a custom property to CH0 and bind to it instead of the.name property.  
Or if you want to use the Data Integer inside your UDT to drive your multistate indicator, instead of having a template udt custom property, just use a string custom property with the path to the root of your udt tag instance and use a indirect binding in your multistate indicator to find your tag with a binding like _ **{PathToTagHere}/Data** _ and any other component should have a smiliar binding scheme.
