# Tag Quality with Perspective Expression Structure

**URL:** <https://forum.inductiveautomation.com/t/tag-quality-with-perspective-expression-structure/82588>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 1, 2023, 2:19pm UTC](https://forum.inductiveautomation.com/t/tag-quality-with-perspective-expression-structure/82588 "2023-12-01T14:19:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Avidesh\_Bissoon](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@Avidesh\_Bissoon](https://forum.inductiveautomation.com/u/Avidesh_Bissoon)\
**Post date:** [December 1, 2023, 2:19pm UTC](https://forum.inductiveautomation.com/t/tag-quality-with-perspective-expression-structure/82588/1 "2023-12-01T14:19:40Z")

</div>

Hi,

Is there a way to have Expression Structure Object members return a QualifiedValue object of the associated OPC tag?

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

I want to have it such that if the remote or local opc tags are of "bad quality", the data binding throws an error and the associated component overlay is active.

---

<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:** [December 1, 2023, 3:20pm UTC](https://forum.inductiveautomation.com/t/tag-quality-with-perspective-expression-structure/82588/2 "2023-12-01T15:20:51Z")

</div>

Is there a reason you are doing this in a structure binding instead of individual tag indirect bindings (the `tag()` expression function is the source of much grief) ?

---

<div class="post-metadata">

**Author:** ![Avidesh\_Bissoon](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@Avidesh\_Bissoon](https://forum.inductiveautomation.com/u/Avidesh_Bissoon)\
**Post date:** [December 1, 2023, 5:47pm UTC](https://forum.inductiveautomation.com/t/tag-quality-with-perspective-expression-structure/82588/3 "2023-12-01T17:47:15Z")

</div>

The reason is: this data binding is tied to the text prop of a label. I want the label to display "Local" or "Remote" based on the state (1 or 0) of the individual tags. I am using a script transform to do the logic.

Eg. if (Local == True and Remote == False):  
ret = "Local"  
return ret

I also wanted the functionality where if the local or remote tag has a bad quality, the label will show a overlay indicating an error (bad data quality). This is why initially I placed it as a input (object member) into the expression structure but it does not work like that.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [December 1, 2023, 6:38pm UTC](https://forum.inductiveautomation.com/t/tag-quality-with-perspective-expression-structure/82588/4 "2023-12-01T18:38:20Z")

</div>

```auto
if (Local == True and Remote == False):
ret = "Local"
return ret

```

can be reduced to

```auto
if Local and !Remote:
    return "Local"
return "Remote"

```

but running a script transform is probably quite an inefficient way to do the job. One alternative is to create an expression tag to calculate the result. This has the advantage that it should pass through a quality error if there is one. Expression:

```auto
if(
	{[~]Local} && !{[~]Remote},
	"Local",
	"Remote"
)

```

Then just use a tag binding on the label and point it to the expression tag.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 2, 2023, 10:22am UTC](https://forum.inductiveautomation.com/t/tag-quality-with-perspective-expression-structure/82588/5 "2023-12-02T10:22:08Z")

</div>

As with others, definitely don't use `tag(...) ` or a script transform for such a simple task. You should use script transforms only if you can't achieve the same thing with an expression binding, as they add more load to the gateway
