# Multistate Indicator wanted to show Error in Text if the value is out of range

**URL:** <https://forum.inductiveautomation.com/t/multistate-indicator-wanted-to-show-error-in-text-if-the-value-is-out-of-range/88248>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [April 2, 2024, 5:05pm UTC](https://forum.inductiveautomation.com/t/multistate-indicator-wanted-to-show-error-in-text-if-the-value-is-out-of-range/88248 "2024-04-02T17:05:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harmeet\_Singh\_Anand](https://avatars.discourse-cdn.com/v4/letter/h/c6cbf5/32.png) [@Harmeet\_Singh\_Anand](https://forum.inductiveautomation.com/u/Harmeet_Singh_Anand)\
**Post date:** [April 2, 2024, 5:05pm UTC](https://forum.inductiveautomation.com/t/multistate-indicator-wanted-to-show-error-in-text-if-the-value-is-out-of-range/88248/1 "2024-04-02T17:05:14Z")

</div>

Hi Team,  
I have taken one multistate indication, in which there are 6 values.  
0 = unknown  
1 = block  
2 = vent  
3 = supply  
4 = blocking  
5 = venting  
6 = supplying

according to the state (0,1,2,3,4,5,6) of the tag, I can show the text ( vent, block, supply...) example - if the value is 2 it will show the text vent. I want to show an error text if the state is 7 8 or in minus. Any help?

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

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [April 2, 2024, 6:33pm UTC](https://forum.inductiveautomation.com/t/multistate-indicator-wanted-to-show-error-in-text-if-the-value-is-out-of-range/88248/2 "2024-04-02T18:33:34Z")

</div>

Create a custom property and bind your state source to that. Then, do an expression binding on the state property of the multistate indicator that checks the custom property with the state value. Have it return a -1 if out of range, otherwise let it pass the normal value through. Create another state on your indicator with a value of -1 that displays your error message.

---

<div class="post-metadata">

**Author:** ![Harmeet\_Singh\_Anand](https://avatars.discourse-cdn.com/v4/letter/h/c6cbf5/32.png) [@Harmeet\_Singh\_Anand](https://forum.inductiveautomation.com/u/Harmeet_Singh_Anand)\
**Post date:** [April 3, 2024, 12:19pm UTC](https://forum.inductiveautomation.com/t/multistate-indicator-wanted-to-show-error-in-text-if-the-value-is-out-of-range/88248/3 "2024-04-03T12:19:35Z")

</div>

Hi Ryan,  
Thanks for the response, I am new to this, can you please elaborate? I tried above solution but could not reach it 😐.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [April 3, 2024, 6:21pm UTC](https://forum.inductiveautomation.com/t/multistate-indicator-wanted-to-show-error-in-text-if-the-value-is-out-of-range/88248/4 "2024-04-03T18:21:28Z")

</div>

Create a custom property on the multistate indicator by right clicking the specific multistate indicator in the project browser tree and selecting customizers -\> custom properties.

> **Customizer Menu**
>
> ![MultiInd_01](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/629508329cc1e28a6e3843b2421a570f765dfc9f.png)

In the dialog, make a new integer property and name it whatever you want.

> **Custom Property**
>
> ![MultiInd_02](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/f/af52f4d91d6bb1b32f2da8d3e7b4c27437c4e1de.png)

On that new custom property, bind the source of your state value to it. In your case, take the binding from the `State` property and apply it to this new custom property

> **Example Binding to custom property**
>
> ![MultiInd_03](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/7/3723e4fbc4aabf810ffbfad9e6696ae1aff05553.png)

Then make an expression binding on the `State` property of the indicator that looks something along the lines of

```auto
if(
	{New Template.Multi State Indicator.stateSource} >= 0 ||
	{New Template.Multi State Indicator.stateSource} < 7,
	{New Template.Multi State Indicator.stateSource}, -1
)

```

The exact path to the component/property will vary according to your view's/template's structure.

In your multistate indicator, add a state that looks for value -1, and change the text to display some error text.

> **Out of bounds state**
>
> ![MultiInd_04](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/7/27766b9cbc31d2661f17abf78dd4616007838847.png)

Now if your state value goes below 0 or above 6, your multistate indicator should show 'Out Of Bounds'

---

<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:** [April 3, 2024, 6:26pm UTC](https://forum.inductiveautomation.com/t/multistate-indicator-wanted-to-show-error-in-text-if-the-value-is-out-of-range/88248/5 "2024-04-03T18:26:03Z")

</div>

Or, add a state at 7 with the same settings as -1. No expression required.

EDIT: Hold on a sec. You may have to clamp your state at -1

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [April 3, 2024, 6:28pm UTC](https://forum.inductiveautomation.com/t/multistate-indicator-wanted-to-show-error-in-text-if-the-value-is-out-of-range/88248/6 "2024-04-03T18:28:56Z")

</div>

Will that fail over gracefully if the value is above 7? I vaguely remember having issues with that at some point, which is when I started doing the expressions.

---

<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:** [April 3, 2024, 6:29pm UTC](https://forum.inductiveautomation.com/t/multistate-indicator-wanted-to-show-error-in-text-if-the-value-is-out-of-range/88248/7 "2024-04-03T18:29:33Z")

</div>

It's open ended until the next setpoint.

---

<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:** [April 3, 2024, 6:31pm UTC](https://forum.inductiveautomation.com/t/multistate-indicator-wanted-to-show-error-in-text-if-the-value-is-out-of-range/88248/8 "2024-04-03T18:31:46Z")

</div>

Yep, you would need to clamp the negative value anyway, so you may as well cover the upper ones as well.
