# Multi State Tags

**URL:** <https://forum.inductiveautomation.com/t/multi-state-tags/71320>\
**Category:** Ignition\
**Created:** [March 20, 2023, 5:56pm UTC](https://forum.inductiveautomation.com/t/multi-state-tags/71320 "2023-03-20T17:56:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Levi\_Overmyer](https://avatars.discourse-cdn.com/v4/letter/l/5f9b8f/32.png) [@Levi\_Overmyer](https://forum.inductiveautomation.com/u/Levi_Overmyer)\
**Post date:** [March 20, 2023, 5:56pm UTC](https://forum.inductiveautomation.com/t/multi-state-tags/71320/1 "2023-03-20T17:56:07Z")

</div>

Hello,

I am adding tags from a PLC. It is a multi state tag. When the tag has a number 1= production. A number 2= Clean mode and a number 3= manual mode. I am adding this to one of transaction groups. How do I allow my transaction group to state "manual mode when the PLC tag reads 3, and "Clean Mode" when PLC tag reads 2? In the HMI program on the machine it is considered a multi state indicator.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [March 20, 2023, 6:06pm UTC](https://forum.inductiveautomation.com/t/multi-state-tags/71320/2 "2023-03-20T18:06:04Z")

</div>

Option 1:  
In your transaction group items, instead of using the raw tag, right click and add an expression item. Use a `case` to map the integer to a string value. Then set the expressions item's target type to a database field with a target name that matches your DB field.

```auto
case({[~]PLC/State},
	2, 'Clean Mode',
	3, 'Manual Mode',
	'Production'
)

```

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/8/18a607f911c3cadf8773abec710645968f5265b8.png)

Option 2:  
Just log the integer value in your database and create a translation table in the db that you would join on your history table to map the integers to string values. I use this method myself.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [March 20, 2023, 6:44pm UTC](https://forum.inductiveautomation.com/t/multi-state-tags/71320/3 "2023-03-20T18:44:00Z")

</div>

> [@dkhayes117](#):
>
> Option 2:  
> Just log the integer value in your database and create a translation table in the db that you would join on your history table to map the integers to string values. I use this method myself.

This. Especially if you have more than one similar application.

---

<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:** [March 20, 2023, 8:03pm UTC](https://forum.inductiveautomation.com/t/multi-state-tags/71320/4 "2023-03-20T20:03:56Z")

</div>

I would recommend storing the digital value in the database and doing an expression mapping transform to convert the values to text at the point of display. This also has the benefit of making your database international because you can apply translations in the Ignition application.

 ![Mapping Binding](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/e/eed763f98bed49ddef4af13a69c2290b3fa29048.png)
