# \[BUG\] Expression returning good value when tag in condition is bad

**URL:** <https://forum.inductiveautomation.com/t/bug-expression-returning-good-value-when-tag-in-condition-is-bad/62574>\
**Category:** Ignition\
**Tags:** perspective, vision\
**Created:** [August 2, 2022, 6:10am UTC](https://forum.inductiveautomation.com/t/bug-expression-returning-good-value-when-tag-in-condition-is-bad/62574 "2022-08-02T06:10:21Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [August 2, 2022, 6:10am UTC](https://forum.inductiveautomation.com/t/bug-expression-returning-good-value-when-tag-in-condition-is-bad/62574/1 "2022-08-02T06:10:21Z")

</div>

v8.1.18

In Perspective (haven’t checked Vision), if you bind a component prop to an expression such as `<condition1> && <condition2>` and `<condition1>` is bad quality and `<condition2>` is good quality, the result is different based on the value of `<condition2>`.

If `<condition2>` is false, the return is **good quality** and false  
If `<condition2>` is true, the return is bad quality and false

Simple test View JSON below where the View has 3 custom props:  
cond1: this is bound to a bogus tag and is therefore bad quality  
cond2: this is a simple unbound bool value  
expr: this is bound to `{view.custom.cond1} && {view.custom.cond2}`

If you toggle the value of cond2, the expr will change between false bad quality to false good quality. You can even use `isGood` to test this as well.  
This makes finding bad conditions in expressions REALLY hard!  
I assume it’s got something to do with conditional statements being short-circuited by any false conditions

```auto
{
  "custom": {
    "cond1": null,
    "cond2": false,
    "expr": false
  },
  "params": {},
  "propConfig": {
    "custom.cond1": {
      "binding": {
        "config": {
          "fallbackDelay": 2.5,
          "mode": "direct",
          "tagPath": "asdasd"
        },
        "type": "tag"
      },
      "persistent": true
    },
    "custom.cond2": {
      "persistent": true
    },
    "custom.expr": {
      "binding": {
        "config": {
          "expression": "{view.custom.cond1} \u0026\u0026 {view.custom.cond2}"
        },
        "type": "expr"
      },
      "persistent": true
    }
  },
  "props": {},
  "root": {
    "meta": {
      "name": "root"
    },
    "props": {
      "direction": "column"
    },
    "type": "ia.container.flex"
  }
}

```

---

<div class="post-metadata">

**Author:** ![Brodie\_Bresette](https://avatars.discourse-cdn.com/v4/letter/b/73ab20/32.png) [@Brodie\_Bresette](https://forum.inductiveautomation.com/u/Brodie_Bresette)\
**Post date:** [May 9, 2023, 8:13pm UTC](https://forum.inductiveautomation.com/t/bug-expression-returning-good-value-when-tag-in-condition-is-bad/62574/2 "2023-05-09T20:13:03Z")

</div>

I just ran into this issue as well, is there any progress on this bug?
