# Compatibility problem for Dashboard2.0 with "Switch"-nodes text label

**URL:** <https://discourse.nodered.org/t/compatibility-problem-for-dashboard2-0-with-switch-nodes-text-label/94771>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [21 January 2025 08:46 UTC](https://discourse.nodered.org/t/compatibility-problem-for-dashboard2-0-with-switch-nodes-text-label/94771 "2025-01-21T08:46:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrX](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrx/32/74473_2.png) [@MrX](https://discourse.nodered.org/u/MrX)\
**Post date:** [21 January 2025 08:46 UTC](https://discourse.nodered.org/t/compatibility-problem-for-dashboard2-0-with-switch-nodes-text-label/94771/1 "2025-01-21T08:46:23Z")

</div>

For all my SONOFF switches (~30pcs) I use “Subflow” for simplicity and decrease the complexity for my Dashboard 1.0. The “Subflow” includes a lot of functions e.q. ON/OFF, Timer, detect “On/Offline” state, enable “Locked” ON/OFF-button, custom color with CSS) by using “Environment variable”.  
The text label and MQTT Topic is defined with “Environment variable” and sent from the “Function” node to the “Switch” node. See flow  
Subflow: MQTT-IN node =\> FUNCTION node =\> SWITCH node =\> MQTT OUT node

Subflows “Environment variable” MyLabel = ”Living room lamp”  
“Function” node: msg.MyLabel2 = env.get("MyLabel")  
“Switch” node: Input field is “{{MyLabel2}}"

Problem: When I try to convert old Dashboard to FlowFuse’s Dashboard2.0, the “Switch”-node doesn’t read the {{msg.MyLabel2}} message in the “Label”-field.

Q: Doesn’t “Dashboard2.0” support to set the “Switch”-node label with value of {{msg.topic}} ?

Q: If it’s not supported, is there any other solution to set the label in the “Switch”-node ?

P.S: Using NodeRed v4.0.0, NodeJs v18.20.5, Linux 6.1.0-30-amd64 x64 LE, Linux Mint LMDE

---

<div class="post-metadata">

**Author:** ![MrX](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrx/32/74473_2.png) [@MrX](https://discourse.nodered.org/u/MrX)\
**Post date:** [21 January 2025 09:33 UTC](https://discourse.nodered.org/t/compatibility-problem-for-dashboard2-0-with-switch-nodes-text-label/94771/2 "2025-01-21T09:33:14Z")

</div>

I found the solution by using ChatGPT:  
MyLabel2 = env.get("MyLabel")  
msg.ui\_update = { label: MyLabel2 };

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [21 January 2025 09:36 UTC](https://discourse.nodered.org/t/compatibility-problem-for-dashboard2-0-with-switch-nodes-text-label/94771/3 "2025-01-21T09:36:27Z")

</div>

> [@MrX](#):
>
> Q: Doesn’t “Dashboard2.0” support to set the “Switch”-node label with value of {{msg.topic}} ?

No. However there is a [PR](https://github.com/FlowFuse/node-red-dashboard/pull/1237) that introduces the use of the STD TypedInput (not merged)

> [@MrX](#):
>
> Q: If it’s not supported, is there any other solution to set the label in the “Switch”-node ?

Yes, as detailed in the [online docs](https://dashboard.flowfuse.com/nodes/widgets/ui-switch.html) by sending a value into it in `msg.ui_update.label`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 February 2025 09:36 UTC](https://discourse.nodered.org/t/compatibility-problem-for-dashboard2-0-with-switch-nodes-text-label/94771/4 "2025-02-20T09:36:28Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
