# Can you use an Expression Tag's name to get the value of an OPC tag with a similar name?

**URL:** <https://forum.inductiveautomation.com/t/can-you-use-an-expression-tags-name-to-get-the-value-of-an-opc-tag-with-a-similar-name/90538>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [May 17, 2024, 2:00am UTC](https://forum.inductiveautomation.com/t/can-you-use-an-expression-tags-name-to-get-the-value-of-an-opc-tag-with-a-similar-name/90538 "2024-05-17T02:00:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![r123](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@r123](https://forum.inductiveautomation.com/u/r123)\
**Post date:** [May 17, 2024, 2:00am UTC](https://forum.inductiveautomation.com/t/can-you-use-an-expression-tags-name-to-get-the-value-of-an-opc-tag-with-a-similar-name/90538/1 "2024-05-17T02:00:31Z")

</div>

I'm using an expression tag to read the value of another OPC tag. Everything works but I'd like to use the expression tags name to help build the expression.

Expression tag is `"Tag1"`  
OPC tag is `"Tag1 OPC"`

In the expression of "Tag1" this will read the value.  
`{[.]Tag1 OPC}`

I can use the tag function and it works but I've read that it should be avoided as it adds more overhead.  
`tag("[.]"+{TagName}+" OPC")`

Not sure if a custom property can help. It needs to use the name/path of the expression tag `"Tag1"` to read the value of the custom property and so far I've just been able to pass the correct OPC tag name and I'd just need to use the tag() function again.

---

<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:** [May 17, 2024, 11:20am UTC](https://forum.inductiveautomation.com/t/can-you-use-an-expression-tags-name-to-get-the-value-of-an-opc-tag-with-a-similar-name/90538/2 "2024-05-17T11:20:04Z")

</div>

The `tag()` function is fine in expression tags. (It's the only place it's appropriate--there's no other way to do indirection in expression tags.)

---

<div class="post-metadata">

**Author:** ![r123](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@r123](https://forum.inductiveautomation.com/u/r123)\
**Post date:** [May 17, 2024, 2:55pm UTC](https://forum.inductiveautomation.com/t/can-you-use-an-expression-tags-name-to-get-the-value-of-an-opc-tag-with-a-similar-name/90538/3 "2024-05-17T14:55:51Z")

</div>

> [@pturmel](#):
>
> The `tag()` function is fine in expression tags

Thanks for the info. I'm a little paranoid as every tag has a partner expression tag. I'm worried that I'll run into a processing issue once more systems are added.

---

<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:** [May 17, 2024, 3:39pm UTC](https://forum.inductiveautomation.com/t/can-you-use-an-expression-tags-name-to-get-the-value-of-an-opc-tag-with-a-similar-name/90538/4 "2024-05-17T15:39:22Z")

</div>

What is your reasoning for using the expression tags? An indirect tag binding might be a better fit for what you're doing.

Also, if you're working in perspective you can do a lot with transforms.
