# Quick Method For Inverting OPC Tag

**URL:** <https://forum.inductiveautomation.com/t/quick-method-for-inverting-opc-tag/33864>\
**Category:** Ignition\
**Created:** [April 11, 2020, 1:49pm UTC](https://forum.inductiveautomation.com/t/quick-method-for-inverting-opc-tag/33864 "2020-04-11T13:49:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgraham](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@jgraham](https://forum.inductiveautomation.com/u/jgraham)\
**Post date:** [April 11, 2020, 1:49pm UTC](https://forum.inductiveautomation.com/t/quick-method-for-inverting-opc-tag/33864/1 "2020-04-11T13:49:50Z")

</div>

I have been binding two toggle switch svgs on top of one another using the visible binding of the OPC tag for one state (on state) and an expression binding using the same tag for the opposite state (off state). Ie on/off. Is there a way of inverting the off state so that I can just use both visible bindings based on the tag itself rather then using two different methods?

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [April 11, 2020, 2:21pm UTC](https://forum.inductiveautomation.com/t/quick-method-for-inverting-opc-tag/33864/2 "2020-04-11T14:21:19Z")

</div>

No matter how you look at it you have to evaluate the state of the tag.  
You should create a template with both images in it, tie the visible properties to a custom property on the template the way you do it now.  
Then you just set the tag once on the template when you use it.  
[https://docs.inductiveautomation.com/display/DOC79/Template+-+Indirect+Binding](https://docs.inductiveautomation.com/display/DOC79/Template+-+Indirect+Binding)  
First image visible binding is theTag  
Second image visible is !theTag (Not theTag)

---

<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:** [April 11, 2020, 2:35pm UTC](https://forum.inductiveautomation.com/t/quick-method-for-inverting-opc-tag/33864/3 "2020-04-11T14:35:26Z")

</div>

No, there’s no property you can bind that means “Hidden” instead of “Visible”. If you need to invert the sense to make your logic work, there’s no way to avoid an expression to do so. In a situation like yours, where you need both senses, consider binding the inversion expression to the positive property on the other object. That saves a tag binding, and simplifies if the tag binding was indirect.

---

<div class="post-metadata">

**Author:** ![jgraham](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@jgraham](https://forum.inductiveautomation.com/u/jgraham)\
**Post date:** [April 11, 2020, 3:04pm UTC](https://forum.inductiveautomation.com/t/quick-method-for-inverting-opc-tag/33864/4 "2020-04-11T15:04:17Z")

</div>

Sounds good. Thanks all…much appreciated
