# Indirect tag in Expression

**URL:** <https://forum.inductiveautomation.com/t/indirect-tag-in-expression/87535>\
**Category:** Ignition\
**Created:** [March 19, 2024, 7:36am UTC](https://forum.inductiveautomation.com/t/indirect-tag-in-expression/87535 "2024-03-19T07:36:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![O\_E](https://avatars.discourse-cdn.com/v4/letter/o/c57346/32.png) [@O\_E](https://forum.inductiveautomation.com/u/O_E)\
**Post date:** [March 19, 2024, 7:36am UTC](https://forum.inductiveautomation.com/t/indirect-tag-in-expression/87535/1 "2024-03-19T07:36:34Z")

</div>

Hi  
Im trying to make a color scheme for alarm values i manage to use direct links but when i switch over to a indirect tag it will not work.

There are several variables i want to use so i cant manage it in a simple tag setup

Are there a way of using indirect tags in expression ?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [March 19, 2024, 7:49am UTC](https://forum.inductiveautomation.com/t/indirect-tag-in-expression/87535/2 "2024-03-19T07:49:46Z")

</div>

There's a `tag` expression function that allows you to read an arbitrary tag path.  
BUT it's usually recommended to avoid using it, because of performances issues.  
I'll suggest two alternative methods:

- create an intermediate custom property that will be just an indirect tag binding, and you can reference this in an expression. Use this if you need the same tag for several calculations.
- If you're on perspective, you can use an indirect tag binding and then an expression transform, using `{value}` in the expression where you need the tag's value.

---

<div class="post-metadata">

**Author:** ![O\_E](https://avatars.discourse-cdn.com/v4/letter/o/c57346/32.png) [@O\_E](https://forum.inductiveautomation.com/u/O_E)\
**Post date:** [March 19, 2024, 8:00am UTC](https://forum.inductiveautomation.com/t/indirect-tag-in-expression/87535/3 "2024-03-19T08:00:19Z")

</div>

Hi  
Im working in Perspective, could you expand on the last point ?

I have never gotten the expression transform to work, the code works in the Expression, but in the Tag-\>Expression it fails.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/7/b7cc72e14d59d040b0e0145e3f6af2e2100285e4.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/8/68f39043c20925ef09a058bf94364f79191461d4.png)

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [March 19, 2024, 8:07am UTC](https://forum.inductiveautomation.com/t/indirect-tag-in-expression/87535/4 "2024-03-19T08:07:07Z")

</div>

Because that's not an expression transform, that's an expression tag binding.  
See the `Add Transform` button right below the fallback delay ? Click on this.

---

<div class="post-metadata">

**Author:** ![O\_E](https://avatars.discourse-cdn.com/v4/letter/o/c57346/32.png) [@O\_E](https://forum.inductiveautomation.com/u/O_E)\
**Post date:** [March 19, 2024, 8:12am UTC](https://forum.inductiveautomation.com/t/indirect-tag-in-expression/87535/5 "2024-03-19T08:12:01Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/6/8602cd59d3a58edd15ed6e51be693846ddefadd2.png)

still the same fault

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [March 19, 2024, 8:29am UTC](https://forum.inductiveautomation.com/t/indirect-tag-in-expression/87535/6 "2024-03-19T08:29:43Z")

</div>

You need to go back to the basics.

> **[Learn Ignition at Your Own Pace](https://www.inductiveuniversity.com/)**
>
> Inductive University is a completely free online learning platform
> to help you learn Ignition by Inductive Automation®, the most powerful SCADA software in the world

> **[Transforms | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/working-with-perspective-components/bindings-in-perspective/transforms)**
>
> Transforms offer a chance to alter the value returned from a binding. For example, you can bind a property to an integer value and use a transform to map the numerical value to a particular color, all from the same interface.

Also, you're NOT doing what I suggested:

> you can use an **indirect tag binding** and then an **expression transform** , using `{value}` in the expression where you need the tag's value.

> that's not an expression transform, that's an expression tag binding.

I'll give you an example, but you really, REALLY need to learn the basics (and pay careful attention to what people tell you in their answers).  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/8/38370bc28ea1032d65bb2362c33722b85b95d09e.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/4/3459bc1e7778018dafa4896de5c0027569d2f6e8.png)

Now, you're using 2 tags. You can't pull the data from 2 tags in an indirect tag binding: it's used to build the path for just one tag.  
So if both tag paths need to be dynamically built, use the first method I suggested: 2 custom properties with a single indirect tag binding each, and then you can use those props in an other expression:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/1/614e4b762c30f9e85291e3783df7515438d8f98c.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/0/90f2c4e36a0d39db8162e7ae1d83cc5610f323bf.png)

One more things: If your tags can only take the values 0 and 1, they should probably be booleans instead of integers.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/e/0e1a18541b4f9ca021a3f913ed261a1c689609d8.png)

---

<div class="post-metadata">

**Author:** ![O\_E](https://avatars.discourse-cdn.com/v4/letter/o/c57346/32.png) [@O\_E](https://forum.inductiveautomation.com/u/O_E)\
**Post date:** [March 19, 2024, 9:02am UTC](https://forum.inductiveautomation.com/t/indirect-tag-in-expression/87535/7 "2024-03-19T09:02:13Z")

</div>

in the end i want to compare High and Low alarm settings towards the process value for the tag an sett colours for the different stages.  
I have managed this fine with direct tags, but thats the problem, when i try to convert it to indirect tags in the Expression as i want to use it on several analog tags.

Im just using simple tags with simple values here to just solve the issue at hand,  
Using Indirect tags in expression
