# Style/classes help

**URL:** <https://forum.inductiveautomation.com/t/style-classes-help/115970>\
**Category:** General Discussion\
**Created:** [June 12, 2026, 11:35pm UTC](https://forum.inductiveautomation.com/t/style-classes-help/115970 "2026-06-12T23:35:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![casian](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@casian](https://forum.inductiveautomation.com/u/casian)\
**Post date:** [June 12, 2026, 11:35pm UTC](https://forum.inductiveautomation.com/t/style-classes-help/115970/1 "2026-06-12T23:35:05Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/c/7ca8d6809f12c1f0a26ac4488f8045a28f42f2a0.png)

can anybody please help with what I'm doing wrong?

the styles exist and are valid but they don't get applied

---

<div class="post-metadata">

**Author:** ![Jasmine\_Quick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jasmine_quick/32/80380_2.png) [@Jasmine\_Quick](https://forum.inductiveautomation.com/u/Jasmine_Quick)\
**Post date:** [June 13, 2026, 4:52am UTC](https://forum.inductiveautomation.com/t/style-classes-help/115970/2 "2026-06-13T04:52:01Z")

</div>

Could you bind the view.custom.state value to classes itself, and use a map transform to set the class you want as the result?

---

<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:** [June 13, 2026, 11:48am UTC](https://forum.inductiveautomation.com/t/style-classes-help/115970/3 "2026-06-13T11:48:30Z")

</div>

You're using a heavy script transform for something that can easily be accommodated for within an expression or map binding, which are significantly less resource expensive =\> more scalable.

Regardless however, to answer the "why" of why that isn't working, `value` is bound to a static string `"view.custom.state"`; this should be `{view.custom.state}`.

But again, don't use a script binding, just use an expression; design for efficiency from the start so you don't give yourself painful work in the future.

```python
case({view.custom.state}
  ,0,".../stopped"
  ,1,".../running"
  ,2,".../faulted"
  ,".../stopped"
) +
" <otherClasses>"

```

---

<div class="post-metadata">

**Author:** ![casian](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@casian](https://forum.inductiveautomation.com/u/casian)\
**Post date:** [June 15, 2026, 4:58pm UTC](https://forum.inductiveautomation.com/t/style-classes-help/115970/4 "2026-06-15T16:58:33Z")

</div>

Thanks for the input.

I tried your suggestion but still doesn't work

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/d/7d78728300d83baa382a8ad7a955b0c316a646f3.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:** [June 15, 2026, 5:08pm UTC](https://forum.inductiveautomation.com/t/style-classes-help/115970/5 "2026-06-15T17:08:08Z")

</div>

Small cross-language syntax mistake. We all do it 🙂

> **[Switch​ - Expression Language and Syntax | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/platform/expression-language-and-syntax#switch)**
>
> The expression language is used to define dynamic values for component properties and Expression tags. Expressions often involve one or more other values that are used to calculate a final value. In most cases, expressions only return a value. |...

---

<div class="post-metadata">

**Author:** ![Samuel\_Sueur](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Samuel\_Sueur](https://forum.inductiveautomation.com/u/Samuel_Sueur)\
**Post date:** [June 15, 2026, 5:36pm UTC](https://forum.inductiveautomation.com/t/style-classes-help/115970/6 "2026-06-15T17:36:57Z")

</div>

I mean `case` is also viable, you just need to add a default value in the event the value you're inspecting does not match any defined cases.

For you, that'd be:

```python
case({view.custom.state},
0, "exchange/water-pack/components/symbol-state/stopped",
1, "exchange/water-pack/components/symbol-state/running",
2, "exchange/water-pack/components/symbol-state/faulted",
""
)

```

The last set of `""` is important for this to work.

---

<div class="post-metadata">

**Author:** ![casian](https://avatars.discourse-cdn.com/v4/letter/c/b19c9b/32.png) [@casian](https://forum.inductiveautomation.com/u/casian)\
**Post date:** [June 15, 2026, 5:54pm UTC](https://forum.inductiveautomation.com/t/style-classes-help/115970/7 "2026-06-15T17:54:12Z")

</div>

yes this worked

thanks all

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/f/2fce399d879805d1d9454d59b482a3c2e01c3bfc.png)
