# Combining Indirect Tag Binding and Expression Binding?

**URL:** <https://forum.inductiveautomation.com/t/combining-indirect-tag-binding-and-expression-binding/11117>\
**Category:** General Discussion\
**Created:** [January 26, 2016, 8:40am UTC](https://forum.inductiveautomation.com/t/combining-indirect-tag-binding-and-expression-binding/11117 "2016-01-26T08:40:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ian](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@ian](https://forum.inductiveautomation.com/u/ian)\
**Post date:** [January 26, 2016, 8:40am UTC](https://forum.inductiveautomation.com/t/combining-indirect-tag-binding-and-expression-binding/11117/1 "2016-01-26T08:40:44Z")

</div>

Hi all,

I have a LED Display Component which I would use to display an average of the Three tags value. Let say that their paths are:

[ul]A/B{1}/Name1  
A/B{1}/TotallyDifferentName2  
A/B{1}/AnotherTotallyDifferentName3  
[/ul]

Note that the name of the elements do not form pattern.

The problem I have is that this tag path itself is dynamic, having {1} reference (which is a Custom property of Root Container.index)

Thus I tried the two following approaches:

1. To use Indirect Tag Binding, but this doesn’t allow me to have more than one tag
2. To use Expression Binding, but this doesn’t allow me to have dynamic reference (or it actually does but I do not know how?)

But both have its own shortcoming.

How to solve it?

Should I create some custom properties in the Root Container to handle some in between paths/variables needed? Or actually there is more decent way to solve this?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 26, 2016, 12:27pm UTC](https://forum.inductiveautomation.com/t/combining-indirect-tag-binding-and-expression-binding/11117/2 "2016-01-26T12:27:58Z")

</div>

I think you are on the right path with the custom properties.

Ta add to your example, I’d use the three tags you show with the indirect binding, and then one more to hold the value of {1}.

The reason I say this, is that I tend to be a visual person. I like seeing all the values that eventually go into an expression. Then, when I get a result that I’m not expecting, I can get an idea where the questionable values come from.

---

<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:** [January 26, 2016, 12:46pm UTC](https://forum.inductiveautomation.com/t/combining-indirect-tag-binding-and-expression-binding/11117/3 "2016-01-26T12:46:00Z")

</div>

I too would use intermediate custom properties. In a pinch though, you can do indirect tag references in an expression with the [tag()](https://docs.inductiveautomation.com/display/DOC/tag) expression function.

Edit:

I more strongly recommend against using the `tag()` function now-a-days. See this topic:

> [@Nesting Not Allowed while using Properties in a Template to turn on a Light](http://forum.inductiveautomation.com/t/nesting-not-allowed-while-using-properties-in-a-template-to-turn-on-a-light/33609/16):
>
> Yes, there is. If the items that comprise your tagpath are updated, even if yielding the same result path, the entire expression containing the tag() function will have to execute. With indirect binding, this doesn't happen. The strings themselves have to be reconstructed every time, even if not changing, slowing down the final expression execution. There are a few cases with computed gateway tags where the tag() expression is the only good way to do indirection, and the dynamic stuff above…

---

<div class="post-metadata">

**Author:** ![ian](https://avatars.discourse-cdn.com/v4/letter/i/bb73d2/32.png) [@ian](https://forum.inductiveautomation.com/u/ian)\
**Post date:** [January 27, 2016, 2:13am UTC](https://forum.inductiveautomation.com/t/combining-indirect-tag-binding-and-expression-binding/11117/4 "2016-01-27T02:13:35Z")

</div>

@pturme, @JordanCClark

Thanks for the inputs and confirmation. If that is the standard way of doing it, I would just some intermediate custom properties.
