# Whey doesn't this expression work in vision?

**URL:** <https://forum.inductiveautomation.com/t/whey-doesnt-this-expression-work-in-vision/110048>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [August 21, 2025, 3:38pm UTC](https://forum.inductiveautomation.com/t/whey-doesnt-this-expression-work-in-vision/110048 "2025-08-21T15:38:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cssbrn](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@cssbrn](https://forum.inductiveautomation.com/u/cssbrn)\
**Post date:** [August 21, 2025, 3:38pm UTC](https://forum.inductiveautomation.com/t/whey-doesnt-this-expression-work-in-vision/110048/1 "2025-08-21T15:38:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cssbrn](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@cssbrn](https://forum.inductiveautomation.com/u/cssbrn)\
**Post date:** [August 21, 2025, 3:39pm UTC](https://forum.inductiveautomation.com/t/whey-doesnt-this-expression-work-in-vision/110048/2 "2025-08-21T15:39:40Z")

</div>

It’s just an and gate for 2 bools.

---

<div class="post-metadata">

**Author:** ![cssbrn](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@cssbrn](https://forum.inductiveautomation.com/u/cssbrn)\
**Post date:** [August 21, 2025, 3:41pm UTC](https://forum.inductiveautomation.com/t/whey-doesnt-this-expression-work-in-vision/110048/3 "2025-08-21T15:41:50Z")

</div>

I get this alarm.

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

---

<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:** [August 21, 2025, 3:45pm UTC](https://forum.inductiveautomation.com/t/whey-doesnt-this-expression-work-in-vision/110048/4 "2025-08-21T15:45:34Z")

</div>

It means your binding is to a component property that is not a boolean.

---

<div class="post-metadata">

**Author:** ![cssbrn](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@cssbrn](https://forum.inductiveautomation.com/u/cssbrn)\
**Post date:** [August 21, 2025, 3:49pm UTC](https://forum.inductiveautomation.com/t/whey-doesnt-this-expression-work-in-vision/110048/5 "2025-08-21T15:49:14Z")

</div>

I am trying to change a color using two bools. How do I make this work?

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

---

<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:** [August 21, 2025, 3:51pm UTC](https://forum.inductiveautomation.com/t/whey-doesnt-this-expression-work-in-vision/110048/6 "2025-08-21T15:51:53Z")

</div>

Vision doesn't have transforms for expressions. You will need to either wrap your expression in `if()` and return deliberate colors with `toColor()`, or place that expression on a custom boolean property and use styling.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 21, 2025, 3:52pm UTC](https://forum.inductiveautomation.com/t/whey-doesnt-this-expression-work-in-vision/110048/7 "2025-08-21T15:52:15Z")

</div>

## Option 1

1. Add a custom property (type: boolean) to your component.
2. Use the same expression binding you already have to return a true/false result.
3. Use the style customizer on the component, using your custom property as the 'driving' property, to affect the styles.

## Option 2

Use a more complex expression using the `toColor` function to return an actual color.

```python
toColor(
    if({tag1} && {tag2}, "00FF00", "000000")
)

```

---

<div class="post-metadata">

**Author:** ![cssbrn](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@cssbrn](https://forum.inductiveautomation.com/u/cssbrn)\
**Post date:** [August 21, 2025, 3:53pm UTC](https://forum.inductiveautomation.com/t/whey-doesnt-this-expression-work-in-vision/110048/8 "2025-08-21T15:53:17Z")

</div>

Thank you.
