# Nested UDT Reference within Tag Reference in Expression Tags

**URL:** <https://forum.inductiveautomation.com/t/nested-udt-reference-within-tag-reference-in-expression-tags/97955>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [October 30, 2024, 1:59pm UTC](https://forum.inductiveautomation.com/t/nested-udt-reference-within-tag-reference-in-expression-tags/97955 "2024-10-30T13:59:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Alcide](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@Joe\_Alcide](https://forum.inductiveautomation.com/u/Joe_Alcide)\
**Post date:** [October 30, 2024, 1:59pm UTC](https://forum.inductiveautomation.com/t/nested-udt-reference-within-tag-reference-in-expression-tags/97955/1 "2024-10-30T13:59:25Z")

</div>

Hi Everyone,

New Ignition user, for doing UDT references within Tag references within expression tags. How do you format it? I read the UDT parameters part of 8.1 manual but don't really understand how to apply this to what I want to do.

Attempted Expression (Tag Reference with UDT TankName nested within): {[~]Tanks/{TankName}/FLOW}

Any help would be appreciated, thanks!

---

<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:** [October 30, 2024, 2:01pm UTC](https://forum.inductiveautomation.com/t/nested-udt-reference-within-tag-reference-in-expression-tags/97955/2 "2024-10-30T14:01:50Z")

</div>

This is one of the rare cases where you need to use the [tag()](https://www.docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/advanced/tag) expression function, since you cannot nest brace-delimited parameters within other curly-brace references.

( Do _ **NOT** _ use the `tag()` function in user-interface bindings. )

---

<div class="post-metadata">

**Author:** ![Joe\_Alcide](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@Joe\_Alcide](https://forum.inductiveautomation.com/u/Joe_Alcide)\
**Post date:** [October 30, 2024, 2:03pm UTC](https://forum.inductiveautomation.com/t/nested-udt-reference-within-tag-reference-in-expression-tags/97955/3 "2024-10-30T14:03:49Z")

</div>

Thank you so much! I appreciate the help!

---

<div class="post-metadata">

**Author:** ![Joe\_Alcide](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@Joe\_Alcide](https://forum.inductiveautomation.com/u/Joe_Alcide)\
**Post date:** [October 30, 2024, 2:09pm UTC](https://forum.inductiveautomation.com/t/nested-udt-reference-within-tag-reference-in-expression-tags/97955/4 "2024-10-30T14:09:57Z")

</div>

Can you show me how this works?

Tried the following and all didn't work.

tag("[default]Tanks/%s/FLOW" % {TankName})  
tag("[default]Tanks/{TankName}/FLOW")  
toFloat(tag("[default]Tanks/{TankName}/FLOW"))

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [October 30, 2024, 2:23pm UTC](https://forum.inductiveautomation.com/t/nested-udt-reference-within-tag-reference-in-expression-tags/97955/5 "2024-10-30T14:23:07Z")

</div>

The ~~Tag Expression binding~~ tag() function is expecting a string, the resultant string should be a tag path ~~which is bound to~~.  
From within the binding, if you pick a tag using the 'Browse Tags' picker, you'll see curly braces around that tag. Change the curly braces to double quotes, then start making that tag path dynamic.  
Let's say you want to bind to the following tag (as entered in the ~~Tag~~ Expression binding):  
`tag("[Provider]Path/To/Tag")`

Now, let's assume there is a tag (or property) that contains the VALUE matching some of those paths:  
`[Provider]Some/Other/Path/To/Tag.value == "Path"`

Then, the original path can be updated to concatenate the binding dynamically:  
`tag("[Provider]" + {[Provider]Some/Other/Path/To/Tag} + "/To/Tag")`

The VALUE of the tag in the { } will appear in the string concatenation, and then Ignition will bind to that resultant tag path.

Note that if the provider is omitted entirely (e.g. `"Path/To/Tag"`), then ~~the default provider of the project is used for the binding~~'this provider' is used (same as [~])..

Edit: I misread the original post. Updated to more closely reflect tag() function usage within an expression tag, not an Expression Tag binding within a project as assumed.

---

<div class="post-metadata">

**Author:** ![Joe\_Alcide](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@Joe\_Alcide](https://forum.inductiveautomation.com/u/Joe_Alcide)\
**Post date:** [October 30, 2024, 2:32pm UTC](https://forum.inductiveautomation.com/t/nested-udt-reference-within-tag-reference-in-expression-tags/97955/6 "2024-10-30T14:32:13Z")

</div>

This worked, thank you so much!

For future people: This is what the end product was: tag("[~]Tanks/" + {TankName} + "/FLOW")
