# Tag vs Expression Binding

**URL:** <https://forum.inductiveautomation.com/t/tag-vs-expression-binding/88037>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [March 28, 2024, 3:46pm UTC](https://forum.inductiveautomation.com/t/tag-vs-expression-binding/88037 "2024-03-28T15:46:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [March 28, 2024, 3:46pm UTC](https://forum.inductiveautomation.com/t/tag-vs-expression-binding/88037/1 "2024-03-28T15:46:24Z")

</div>

If an expression binding is only referencing a tag via `{pathToTag}`, instead of using a "Tag" type binding, is there any _real_ difference, other than the icon that appears next to the component?

---

<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:** [March 28, 2024, 4:04pm UTC](https://forum.inductiveautomation.com/t/tag-vs-expression-binding/88037/2 "2024-03-28T16:04:32Z")

</div>

A different code path is used, though ultimately the thing that's managing the subscription will be a tag change listener.

I would expect a 'native' tag binding to offer _slightly_ better performance than an expression binding; probably basically identical once setup but a little bit faster to start up initially.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [March 28, 2024, 4:09pm UTC](https://forum.inductiveautomation.com/t/tag-vs-expression-binding/88037/3 "2024-03-28T16:09:12Z")

</div>

So, I guess the logical next question is, which is better. An expression tag and then a tag binding, or just an expression binding? I would _guess_ the former

---

<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:** [March 28, 2024, 4:10pm UTC](https://forum.inductiveautomation.com/t/tag-vs-expression-binding/88037/4 "2024-03-28T16:10:23Z")

</div>

Depends how many times you need the calculation in the expression and how complex it is.

In terms of _maintenance_, which is definitely going to be a more important factor here, I'd definitely prefer the expression tag, since it'll be much easier to change if you ever need to update the expression.

---

<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:** [March 28, 2024, 4:32pm UTC](https://forum.inductiveautomation.com/t/tag-vs-expression-binding/88037/5 "2024-03-28T16:32:39Z")

</div>

> [@amarks](#):
>
> is there any _real_ difference

Yes, there is one _ **huge** _ difference: expression bindings **must** deliver an answer within the execution thread of the binding. This is particularly important in Vision, where this happens on the single UI thread.

Proper tag bindings, including any indirect bindings, do **not** have to deliver an immediate value--they can wait until the value is available and deliver asynchronously.

You should **always** use tag bindings instead of expressions with a tag reference.

---

<div class="post-metadata">

**Author:** ![robertm](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@robertm](https://forum.inductiveautomation.com/u/robertm)\
**Post date:** [March 28, 2024, 5:48pm UTC](https://forum.inductiveautomation.com/t/tag-vs-expression-binding/88037/6 "2024-03-28T17:48:51Z")

</div>

Along those lines, for style customers, I often create a custom property that is the result of an expression. But I create custom properties also and bind the tags directly to those properties, and then use the properties in the expression. So the expression doesn't have any direct tags, but properties that have direct tag bindings. Is that any better, worse, etc? It makes it so all my widgets are consistent and maintenance is much easier.

---

<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:** [March 28, 2024, 6:47pm UTC](https://forum.inductiveautomation.com/t/tag-vs-expression-binding/88037/7 "2024-03-28T18:47:50Z")

</div>

> [@robertm](#):
>
> So the expression doesn't have any direct tags, but properties that have direct tag bindings.

Yes, this is best.

---

<div class="post-metadata">

**Author:** ![Steve\_Laubach](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steve_laubach/32/60900_2.png) [@Steve\_Laubach](https://forum.inductiveautomation.com/u/Steve_Laubach)\
**Post date:** [March 28, 2024, 7:19pm UTC](https://forum.inductiveautomation.com/t/tag-vs-expression-binding/88037/8 "2024-03-28T19:19:38Z")

</div>

I think it's a good idea to come up with a standard within your company for where you put custom properties to handle indirect bindings efficiently so everyone knows where to look when supporting other people's work.

If I am building a screen or popup that's evaluating information from multiple tags in the same expression I create a custom property for each binding and populate it with an indirect binding. Then my expressions evaluate property references to those custom properties. Another advantage is that you can see live values for what the expression is evaluating if you're troubleshooting something. I especially like how this works out in perspective because of how properties are organized.

I believe this is what @pturmel is saying is optimal so correct me if I'm wrong.
