# Case Statement Binding Question

**URL:** <https://forum.inductiveautomation.com/t/case-statement-binding-question/96329>\
**Category:** Ignition\
**Created:** [September 24, 2024, 2:08am UTC](https://forum.inductiveautomation.com/t/case-statement-binding-question/96329 "2024-09-24T02:08:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan\_Amyette](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@Ryan\_Amyette](https://forum.inductiveautomation.com/u/Ryan_Amyette)\
**Post date:** [September 24, 2024, 2:08am UTC](https://forum.inductiveautomation.com/t/case-statement-binding-question/96329/1 "2024-09-24T02:08:17Z")

</div>

Hello,  
Was trying to use a case statement to bind the state of a couple tags to a display on our HMI. However, I am getting the error seen in the Line 1 EOB Case Statement Error picture. I'm not quite sure why its acting like that default value is a tag, could I get some help/an explanation of what I am doing wrong here?

 ![Line 1 EOB Case Statement](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/5/0537f554698ba98805cadb736a989850410b835a.png)  
 ![Line 1 EOB Case Statement Error](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/4/4457f716e363362f17b6247dca76e9cd06ac8e77.png)

---

<div class="post-metadata">

**Author:** ![Steve\_Laubach](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steve_laubach/32/60900_2.png) [@Steve\_Laubach](https://forum.inductiveautomation.com/u/Steve_Laubach)\
**Post date:** [September 24, 2024, 2:12am UTC](https://forum.inductiveautomation.com/t/case-statement-binding-question/96329/2 "2024-09-24T02:12:49Z")

</div>

You're passing the values incorrectly.

Syntax can be found here:

> **[case | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/expression-functions/logic/case#examples)**
>
> This function acts like the switch statement in C-like programming languages.

---

<div class="post-metadata">

**Author:** ![Ryan\_Amyette](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@Ryan\_Amyette](https://forum.inductiveautomation.com/u/Ryan_Amyette)\
**Post date:** [September 24, 2024, 2:30am UTC](https://forum.inductiveautomation.com/t/case-statement-binding-question/96329/3 "2024-09-24T02:30:59Z")

</div>

Do you mind elaborating on that a bit further? I believe I had used that user manual syntax previously, and re-copy and pasted that syntax for the case statement, but am still getting that error.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/d/0d582bd6e724be77169c95b158428080efd1edac.png)  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/5/f5c7ec6aca92c4f9c5b4a3c1748e54a05e79408f.png)

---

<div class="post-metadata">

**Author:** ![andrew.budaiev](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andrew.budaiev/32/72921_2.png) [@andrew.budaiev](https://forum.inductiveautomation.com/u/andrew.budaiev)\
**Post date:** [September 24, 2024, 2:38am UTC](https://forum.inductiveautomation.com/t/case-statement-binding-question/96329/4 "2024-09-24T02:38:03Z")

</div>

You are in the tag binding, and you are returning a tag path to a tag [default]-1, which is not found.

---

<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:** [September 24, 2024, 2:55am UTC](https://forum.inductiveautomation.com/t/case-statement-binding-question/96329/5 "2024-09-24T02:55:11Z")

</div>

To expand on @andrew.budaiev:  
The tag binding, in expression mode (what you have) is evaluating your supplied expression in order to return a tag **path**.

What you want is to take what you have and drop it into the top level expression binding type. Somewhat confusingly, you're able to read tags within expression bindings just fine - the expression mode of a tag binding is just a more powerful way to make a (possibly bidirectional!) indirect tag binding.

---

<div class="post-metadata">

**Author:** ![Ryan\_Amyette](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@Ryan\_Amyette](https://forum.inductiveautomation.com/u/Ryan_Amyette)\
**Post date:** [September 24, 2024, 4:06am UTC](https://forum.inductiveautomation.com/t/case-statement-binding-question/96329/6 "2024-09-24T04:06:14Z")

</div>

Ahh, that makes sense! Looks like I got it now, thank y'all all for the help!

---

<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:** [September 24, 2024, 12:29pm UTC](https://forum.inductiveautomation.com/t/case-statement-binding-question/96329/7 "2024-09-24T12:29:04Z")

</div>

_Psst!_ Signature blocks on comments are forbidden by [this forum's rules](https://forum.inductiveautomation.com/faq). You need to edit your previous comments to remove that information, and set your email to **not** include it. If you cannot do that latter part, don't reply by email at all.

---

<div class="post-metadata">

**Author:** ![Ryan\_Amyette](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@Ryan\_Amyette](https://forum.inductiveautomation.com/u/Ryan_Amyette)\
**Post date:** [September 24, 2024, 12:54pm UTC](https://forum.inductiveautomation.com/t/case-statement-binding-question/96329/8 "2024-09-24T12:54:25Z")

</div>

My apologies, I believe I have corrected that, and will keep that in mind for the future.
