# Switch in expression binding

**URL:** <https://forum.inductiveautomation.com/t/switch-in-expression-binding/108823>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 23, 2025, 9:20am UTC](https://forum.inductiveautomation.com/t/switch-in-expression-binding/108823 "2025-07-23T09:20:38Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![gauravavhad.1989](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@gauravavhad.1989](https://forum.inductiveautomation.com/u/gauravavhad.1989)\
**Post date:** [July 23, 2025, 9:20am UTC](https://forum.inductiveautomation.com/t/switch-in-expression-binding/108823/1 "2025-07-23T09:20:38Z")

</div>

I want to show text in a label depending on the tag value.  
For eg  
1--A  
2--B  
3--C  
4--D  
5--E

How do i bind the expression if my tag name is Tag1?  
Is it possible by using Switch in expression binding?

---

<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:** [July 23, 2025, 9:30am UTC](https://forum.inductiveautomation.com/t/switch-in-expression-binding/108823/2 "2025-07-23T09:30:49Z")

</div>

Use a tag binding and a map transform.

---

<div class="post-metadata">

**Author:** ![gauravavhad.1989](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@gauravavhad.1989](https://forum.inductiveautomation.com/u/gauravavhad.1989)\
**Post date:** [July 23, 2025, 9:32am UTC](https://forum.inductiveautomation.com/t/switch-in-expression-binding/108823/3 "2025-07-23T09:32:55Z")

</div>

Please elaborate.

---

<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:** [July 23, 2025, 9:33am UTC](https://forum.inductiveautomation.com/t/switch-in-expression-binding/108823/4 "2025-07-23T09:33:55Z")

</div>

I'm not sure what more there is to say...

Use a tag binding to get the tag's value.  
Then add a map transform to map the possible tag values to the string you want.

---

<div class="post-metadata">

**Author:** ![gauravavhad.1989](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@gauravavhad.1989](https://forum.inductiveautomation.com/u/gauravavhad.1989)\
**Post date:** [July 23, 2025, 9:34am UTC](https://forum.inductiveautomation.com/t/switch-in-expression-binding/108823/5 "2025-07-23T09:34:19Z")

</div>

I am actually new to Ignition..but got it...thanks

---

<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:** [July 23, 2025, 9:36am UTC](https://forum.inductiveautomation.com/t/switch-in-expression-binding/108823/6 "2025-07-23T09:36:32Z")

</div>

I would use a case in an expression binding. Only transform if you need to, otherwise use a single binding for performance.

Eg

```python
case({tag}
, 1, "A" 
, 2, "B"
, 3, "C"
, 4, "D"
, 5, "E"
, "invalid"
)

```

Avoid the `switch` expression function like the plague for the only reason being that it's argument syntax is an abomination

---

<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:** [July 23, 2025, 9:38am UTC](https://forum.inductiveautomation.com/t/switch-in-expression-binding/108823/7 "2025-07-23T09:38:37Z")

</div>

I'm not a fan of map transforms anyway, I never use them.  
But it is arguably the simplest way of doing this for a new ignition user, and the simpler to reason about.

---

<div class="post-metadata">

**Author:** ![gauravavhad.1989](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@gauravavhad.1989](https://forum.inductiveautomation.com/u/gauravavhad.1989)\
**Post date:** [July 23, 2025, 9:45am UTC](https://forum.inductiveautomation.com/t/switch-in-expression-binding/108823/8 "2025-07-23T09:45:14Z")

</div>

I tried using case but everytime it shows error configuration.  
but my values start with 0 and then it shows wrong result every time

---

<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:** [July 23, 2025, 9:47am UTC](https://forum.inductiveautomation.com/t/switch-in-expression-binding/108823/9 "2025-07-23T09:47:06Z")

</div>

You ll have to show us what you were trying for us to help

---

<div class="post-metadata">

**Author:** ![Fran\_Dujmovic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/fran_dujmovic/32/70280_2.png) [@Fran\_Dujmovic](https://forum.inductiveautomation.com/u/Fran_Dujmovic)\
**Post date:** [July 23, 2025, 10:02am UTC](https://forum.inductiveautomation.com/t/switch-in-expression-binding/108823/10 "2025-07-23T10:02:43Z")

</div>

What Pascal said about direct tag bindings and Map Transforms is definitely the easiest way to go about this. It should look something like this;

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

---

<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:** [July 23, 2025, 1:02pm UTC](https://forum.inductiveautomation.com/t/switch-in-expression-binding/108823/11 "2025-07-23T13:02:17Z")

</div>

> [@Fran\_Dujmovic](#):
>
> Map Transforms is definitely the easiest way

Not the most performant though (but not nearly as bad as script transforms)

I say, design for performance and scalability where ever you can. That poor choice "it's only this one spot" multiplies and soon you have 100 "just one spot"s that contribute to reduced performance and reduced scalability of your project

---

<div class="post-metadata">

**Author:** ![gauravavhad.1989](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@gauravavhad.1989](https://forum.inductiveautomation.com/u/gauravavhad.1989)\
**Post date:** [July 24, 2025, 6:53am UTC](https://forum.inductiveautomation.com/t/switch-in-expression-binding/108823/12 "2025-07-24T06:53:31Z")

</div>

Thank you....issue resolved
