# \[Solved\]How to change dashboard switch icon from flow?

**URL:** <https://discourse.nodered.org/t/solved-how-to-change-dashboard-switch-icon-from-flow/19085>\
**Category:** Dashboard\
**Created:** [12 December 2019 18:03 UTC](https://discourse.nodered.org/t/solved-how-to-change-dashboard-switch-icon-from-flow/19085 "2019-12-12T18:03:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![waquete](https://avatars.discourse-cdn.com/v4/letter/w/a698b9/32.png) [@waquete](https://discourse.nodered.org/u/waquete)\
**Post date:** [12 December 2019 18:03 UTC](https://discourse.nodered.org/t/solved-how-to-change-dashboard-switch-icon-from-flow/19085/1 "2019-12-12T18:03:33Z")

</div>

Hi!  
I want to change switch icon from flow, I tried the following:  
I have set icon to "custom" in switch properties and I have filled "on icon" field with {{icon}} and matching color with {{color}}.

In a function just before the switch, I have set the variables:

```auto
msg.icon = "battery_alert";  
msg.color = "RED";

```

The button icon does not work, it is replace by a question mark.  
but If I copy paste directly "battery\_alert" & red in switch properties, it works...  
How can I do ?

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [12 December 2019 18:28 UTC](https://discourse.nodered.org/t/solved-how-to-change-dashboard-switch-icon-from-flow/19085/2 "2019-12-12T18:28:02Z")

</div>

Dashboard widgets can be customized by sending supported configurable options using `msg.ui_control`  
See documentation [https://github.com/node-red/node-red-dashboard/blob/master/config-fields.md](https://github.com/node-red/node-red-dashboard/blob/master/config-fields.md)  
for `ui_switch` node it goes like this  
`msg.ui_control = {onicon:"fa-fire",oncolor:"orange",officon:"fa-fire",offcolor:"yellow"}`

---

<div class="post-metadata">

**Author:** ![waquete](https://avatars.discourse-cdn.com/v4/letter/w/a698b9/32.png) [@waquete](https://discourse.nodered.org/u/waquete)\
**Post date:** [12 December 2019 19:08 UTC](https://discourse.nodered.org/t/solved-how-to-change-dashboard-switch-icon-from-flow/19085/3 "2019-12-12T19:08:18Z")

</div>

Works perfectly! thank you !!
