# How to do indirect tag references in expression tag

**URL:** <https://forum.inductiveautomation.com/t/how-to-do-indirect-tag-references-in-expression-tag/7257>\
**Category:** Ignition\
**Created:** [September 13, 2013, 6:42pm UTC](https://forum.inductiveautomation.com/t/how-to-do-indirect-tag-references-in-expression-tag/7257 "2013-09-13T18:42:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [September 13, 2013, 6:42pm UTC](https://forum.inductiveautomation.com/t/how-to-do-indirect-tag-references-in-expression-tag/7257/1 "2013-09-13T18:42:38Z")

</div>

The screenshot below shows first code that works, and then commented out code for what I tried first to accomplish the same thing. The code that works is fine, except that it requires manual editing to scale (when more recipes are added), and it’s on the long side.

Reading help on indirect bindings, it appears that indirect binding within an expression should be possible. But I can’t seem to figure out how to enter an indirect binding to accomplish this without getting an evaluation error. Is there some way to do this? What am I missing?

---

<div class="post-metadata">

**Author:** ![RRRancher](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@RRRancher](https://forum.inductiveautomation.com/u/RRRancher)\
**Post date:** [September 13, 2013, 9:22pm UTC](https://forum.inductiveautomation.com/t/how-to-do-indirect-tag-references-in-expression-tag/7257/2 "2013-09-13T21:22:41Z")

</div>

I don’t think you can do indirect referencing in an expression, but I may be wrong. What you can do though is create one or more custom properties on a root container or elsewhere, and set those for indirect references, then pull them into your expression.

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [September 13, 2013, 9:33pm UTC](https://forum.inductiveautomation.com/t/how-to-do-indirect-tag-references-in-expression-tag/7257/3 "2013-09-13T21:33:16Z")

</div>

Something like

```auto
toStr(tag("[.]" + {[.]activeRecipeIndex} + "/name"))
```

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [September 13, 2013, 10:57pm UTC](https://forum.inductiveautomation.com/t/how-to-do-indirect-tag-references-in-expression-tag/7257/4 "2013-09-13T22:57:10Z")

</div>

Thanks Kyle! That (copy and paste of your code) makes sense and does exactly what I want. I like minimizing and simplifying external bindings required by programming more right into the type (or template, in other cases). Knowing how to do this will be useful as I build more UDTs and templates.

RRRancher, thanks for the tip. That’s another way to do the job, though if the relationship is something I can code internally I prefer that–glad to find out it can be done!

---

<div class="post-metadata">

**Author:** ![rs326](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rs326/32/4500_2.png) [@rs326](https://forum.inductiveautomation.com/u/rs326)\
**Post date:** [November 22, 2018, 1:00pm UTC](https://forum.inductiveautomation.com/t/how-to-do-indirect-tag-references-in-expression-tag/7257/5 "2018-11-22T13:00:51Z")

</div>

Thanks Kyle, This was a great help.
