# Configure Expression Binding

**URL:** <https://forum.inductiveautomation.com/t/configure-expression-binding/37356>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [August 4, 2020, 1:54pm UTC](https://forum.inductiveautomation.com/t/configure-expression-binding/37356 "2020-08-04T13:54:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alejandro01r](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@Alejandro01r](https://forum.inductiveautomation.com/u/Alejandro01r)\
**Post date:** [August 4, 2020, 1:54pm UTC](https://forum.inductiveautomation.com/t/configure-expression-binding/37356/1 "2020-08-04T13:54:16Z")

</div>

Hello guys,  
I am trying to display different “strings” for a label to display states.  
Using - Configure Expression Binding.  
Maybe this is the incorrect way to do it? I could use some help.

IF (  
({[default]Line 3 Filler/Line 3 Production Selection/B20\_3\_[4]} = false) &&  
({[default]Line 3 Filler/Line 3 Production Selection/B20\_3\_[5]} = false) &&  
({[default]Line 3 Filler/Line 3 Production Selection/B20\_3\_[6]} = false),“NO MODE SELECTED”,0)  
||  
IF (  
({[default]Line 3 Filler/Line 3 Production Selection/B20\_3\_[4]} = false) &&  
({[default]Line 3 Filler/Line 3 Production Selection/B20\_3\_[5]} = true) &&  
({[default]Line 3 Filler/Line 3 Production Selection/B20\_3\_[6]} = false),“FILL MODE SELECTED”,0)  
Error\_ExpressionEval.

---

<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:** [August 4, 2020, 2:16pm UTC](https://forum.inductiveautomation.com/t/configure-expression-binding/37356/2 "2020-08-04T14:16:15Z")

</div>

Personally for what your doing, I think a case statement with a binary encoder is more fitting. But I will give an example doing it with if’s and with a case statement. With the if’s, you shouldn’t need the or, you just need to carefully stack them to make it an if/else if. Using case though will be less lines making it easier to add to it or change it later.

The or(||) in the expression is for comparing two values in order to return a true or false, it won’t work for returning a string value based on your two if’s.

```auto
# if you want to use if statements
if(
({[default]Line 3 Filler/Line 3 Production Selection/B20_3_[4]} = false) &&
({[default]Line 3 Filler/Line 3 Production Selection/B20_3_[5]} = false) &&
({[default]Line 3 Filler/Line 3 Production Selection/B20_3_[6]} = false),"NO MODE SELECTED",
if(
({[default]Line 3 Filler/Line 3 Production Selection/B20_3_[4]} = false) &&
({[default]Line 3 Filler/Line 3 Production Selection/B20_3_[5]} = true) &&
({[default]Line 3 Filler/Line 3 Production Selection/B20_3_[6]} = false),"FILL MODE SELECTED",""))

#same thing using a binary encoder and a case statement
case(
binEnc({[default]Line 3 Filler/Line 3 Production Selection/B20_3_[4]},{[default]Line 3 Filler/Line 3 Production Selection/B20_3_[5]},{[default]Line 3 Filler/Line 3 Production Selection/B20_3_[6]})
,0,"NO MODE SELECTED"
,2,"FILL MODE SELECTED"
,"")

```

---

<div class="post-metadata">

**Author:** ![Alejandro01r](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@Alejandro01r](https://forum.inductiveautomation.com/u/Alejandro01r)\
**Post date:** [August 4, 2020, 2:21pm UTC](https://forum.inductiveautomation.com/t/configure-expression-binding/37356/3 "2020-08-04T14:21:43Z")

</div>

Thank you very much!
