# If statement with more than 1 true and false return

**URL:** <https://forum.inductiveautomation.com/t/if-statement-with-more-than-1-true-and-false-return/52684>\
**Category:** Ignition\
**Created:** [November 3, 2021, 5:08pm UTC](https://forum.inductiveautomation.com/t/if-statement-with-more-than-1-true-and-false-return/52684 "2021-11-03T17:08:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamesUalto](https://avatars.discourse-cdn.com/v4/letter/j/54ee81/32.png) [@JamesUalto](https://forum.inductiveautomation.com/u/JamesUalto)\
**Post date:** [November 3, 2021, 5:08pm UTC](https://forum.inductiveautomation.com/t/if-statement-with-more-than-1-true-and-false-return/52684/1 "2021-11-03T17:08:52Z")

</div>

Below expression changes from grey to green if either are true.

I need to also show from grey to red w/ blink if either of two other tags are true.

if ({[default]Area1 Tags/RMWCAM004f/PV} = 1 || {[default]Area1 Tags/RMWCAM004r/PV} = 1, COLOR (60,154,60,255), COLOR (144,144,144,255))

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [November 3, 2021, 5:14pm UTC](https://forum.inductiveautomation.com/t/if-statement-with-more-than-1-true-and-false-return/52684/2 "2021-11-03T17:14:34Z")

</div>

Consider using the binEnc expression: [binEnc - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/binEnc) and then tie the ensuing integer to a style customizer on the object

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [November 3, 2021, 5:16pm UTC](https://forum.inductiveautomation.com/t/if-statement-with-more-than-1-true-and-false-return/52684/3 "2021-11-03T17:16:39Z")

</div>

You can nest `if` statements, like

```auto
if (a, blue,
    if (b, red,
        black
    )
)

```

This works well enough for simple cases but at some point you might want to look into something else than expression’s `if`

---

<div class="post-metadata">

**Author:** ![bpreston](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@bpreston](https://forum.inductiveautomation.com/u/bpreston)\
**Post date:** [November 4, 2021, 7:24pm UTC](https://forum.inductiveautomation.com/t/if-statement-with-more-than-1-true-and-false-return/52684/4 "2021-11-04T19:24:59Z")

</div>

Where you mention blinking, to do that though an expression, you would need something else that cycles at the rate you want to blink. You can do that with another expression tag that you tie into your binEnc that @bschroeder mentioned. The other expression could be as simple as something like(one second pulse):

```auto
getSecond(now())%2

```

---

<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:** [November 4, 2021, 9:21pm UTC](https://forum.inductiveautomation.com/t/if-statement-with-more-than-1-true-and-false-return/52684/5 "2021-11-04T21:21:10Z")

</div>

@JamesUalto, there’s a `</>` code formatting button on the editor toolbar that renders your code readable and preserves linebreaks and indentation. You can edit your question to fix it.
