# If OPC Tag is True, Then Visibility is False

**URL:** <https://forum.inductiveautomation.com/t/if-opc-tag-is-true-then-visibility-is-false/109056>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [July 29, 2025, 12:31pm UTC](https://forum.inductiveautomation.com/t/if-opc-tag-is-true-then-visibility-is-false/109056 "2025-07-29T12:31:37Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![andy.hernandez](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@andy.hernandez](https://forum.inductiveautomation.com/u/andy.hernandez)\
**Post date:** [July 29, 2025, 12:31pm UTC](https://forum.inductiveautomation.com/t/if-opc-tag-is-true-then-visibility-is-false/109056/1 "2025-07-29T12:31:37Z")

</div>

On Vision Module:  
I have the Tag below bound to the Visibility property of an Image.  
Question:  
Is there a way to FLIP the logic directly on this window or do I need to use a Python script?  
If OPC Tag is True, Then Visibility is False  
I already tried these:  
!  
NOT

 ![Screenshot 2025-07-29 082912](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/4/a44374013bd3bdd7440887519ddfe1ccbcc69aa9.png)

---

<div class="post-metadata">

**Author:** ![tgarrison](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tgarrison/32/80965_2.png) [@tgarrison](https://forum.inductiveautomation.com/u/tgarrison)\
**Post date:** [July 29, 2025, 12:33pm UTC](https://forum.inductiveautomation.com/t/if-opc-tag-is-true-then-visibility-is-false/109056/2 "2025-07-29T12:33:56Z")

</div>

Change it from an indirect tag binding to an expression binding. Then you can handle both the indirection and the inversion in one shot.

---

<div class="post-metadata">

**Author:** ![andy.hernandez](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@andy.hernandez](https://forum.inductiveautomation.com/u/andy.hernandez)\
**Post date:** [July 29, 2025, 12:37pm UTC](https://forum.inductiveautomation.com/t/if-opc-tag-is-true-then-visibility-is-false/109056/3 "2025-07-29T12:37:07Z")

</div>

This Image is part of a TEMPLATE, and I need to use INDIRECT tag binding.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 29, 2025, 12:45pm UTC](https://forum.inductiveautomation.com/t/if-opc-tag-is-true-then-visibility-is-false/109056/4 "2025-07-29T12:45:52Z")

</div>

Set up a custom property to hold the "raw value" of the tag. Generally do this on the template root, to help with paths not changing when you potentially move components in and out of groups.

Then use an expression binding on the visibility with the custom property to do the inversion.

```python
!{Tray_Collect.Image 1.traySlots}

```

---

<div class="post-metadata">

**Author:** ![andy.hernandez](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@andy.hernandez](https://forum.inductiveautomation.com/u/andy.hernandez)\
**Post date:** [July 29, 2025, 1:00pm UTC](https://forum.inductiveautomation.com/t/if-opc-tag-is-true-then-visibility-is-false/109056/5 "2025-07-29T13:00:49Z")

</div>

I don't quite follow. Can you elaborate a little more?

---

<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:** [July 29, 2025, 1:01pm UTC](https://forum.inductiveautomation.com/t/if-opc-tag-is-true-then-visibility-is-false/109056/6 "2025-07-29T13:01:11Z")

</div>

> [@tgarrison](#):
>
> Then you can handle both the indirection and the inversion in one shot.

That would require using the `tag()` expression function in your UI. Don't do it.

---

<div class="post-metadata">

**Author:** ![robertm](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@robertm](https://forum.inductiveautomation.com/u/robertm)\
**Post date:** [July 29, 2025, 1:03pm UTC](https://forum.inductiveautomation.com/t/if-opc-tag-is-true-then-visibility-is-false/109056/7 "2025-07-29T13:03:22Z")

</div>

On your template or widget, right click, select custom property, give it a name, type boolean.

In the custom property, bind it to the tag you want to invert.

In the visibility, use an expression of ! CustomPropertyName you created.

---

<div class="post-metadata">

**Author:** ![andy.hernandez](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@andy.hernandez](https://forum.inductiveautomation.com/u/andy.hernandez)\
**Post date:** [July 29, 2025, 1:32pm UTC](https://forum.inductiveautomation.com/t/if-opc-tag-is-true-then-visibility-is-false/109056/8 "2025-07-29T13:32:40Z")

</div>

Steps 1 and 3 done. I need more data for Step 2 where is this (custom property) located at?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/627bd089fd0ca53e358706e4abca262227df5f06.png)  
 ![Screenshot 2025-07-29 092802](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/c/8c49df2859e71cb70084d3fd75d015789e8d9389.png)  
 ![Screenshot 2025-07-29 092949](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/9/5980d1d19d7f08b46c10a0cc70f7e06d83500423.png)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 29, 2025, 1:38pm UTC](https://forum.inductiveautomation.com/t/if-opc-tag-is-true-then-visibility-is-false/109056/9 "2025-07-29T13:38:17Z")

</div>

For two, if you click on the template, your custom property should now appear at the bottom of the property list in the property browser.

For your step 3, you have done this incorrectly.

1. Expressions do not assign values, they return a result.  
The binding should literally be:

```python
!{Tray_Collects.IsVisible}

```

---

<div class="post-metadata">

**Author:** ![andy.hernandez](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@andy.hernandez](https://forum.inductiveautomation.com/u/andy.hernandez)\
**Post date:** [July 29, 2025, 1:42pm UTC](https://forum.inductiveautomation.com/t/if-opc-tag-is-true-then-visibility-is-false/109056/10 "2025-07-29T13:42:50Z")

</div>

Thanks for fixing Step 3  
For step 2 the new properties do show up at the bottom, but I cannot click on it to bind it to the OPC tag. How or where is the actual binding done?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/5/c5d33501eadc23d40b11f61543d99879db000ba5.png)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 29, 2025, 1:51pm UTC](https://forum.inductiveautomation.com/t/if-opc-tag-is-true-then-visibility-is-false/109056/11 "2025-07-29T13:51:09Z")

</div>

You created a template parameter, which you may want to do with a "Tag Path" parameter, but that's a different issue.

Instead, in this instance you want to create an Internal Property. Then you will be able to bind it.

Parameters are expected to get their values from outside of the template.

---

<div class="post-metadata">

**Author:** ![andy.hernandez](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@andy.hernandez](https://forum.inductiveautomation.com/u/andy.hernandez)\
**Post date:** [July 29, 2025, 1:54pm UTC](https://forum.inductiveautomation.com/t/if-opc-tag-is-true-then-visibility-is-false/109056/12 "2025-07-29T13:54:20Z")

</div>

Grateful for your help—that was exactly what I needed
