# Can the value of the switch node, which is 20, be entered and applied from the UI?

**URL:** <https://discourse.nodered.org/t/can-the-value-of-the-switch-node-which-is-20-be-entered-and-applied-from-the-ui/76730>\
**Category:** General\
**Tags:** node-red-dashboard, function-node\
**Created:** [20 March 2023 07:21 UTC](https://discourse.nodered.org/t/can-the-value-of-the-switch-node-which-is-20-be-entered-and-applied-from-the-ui/76730 "2023-03-20T07:21:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GoldD](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@GoldD](https://discourse.nodered.org/u/GoldD)\
**Post date:** [20 March 2023 07:21 UTC](https://discourse.nodered.org/t/can-the-value-of-the-switch-node-which-is-20-be-entered-and-applied-from-the-ui/76730/1 "2023-03-20T07:21:25Z")

</div>

![제목 1234](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/e/ee676a09c0570bb0000903add3444b90fba6a0ab.jpeg)  
Can I use a text input from the UI to enter and apply the value of 20, as shown in the picture?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [20 March 2023 08:17 UTC](https://discourse.nodered.org/t/can-the-value-of-the-switch-node-which-is-20-be-entered-and-applied-from-the-ui/76730/2 "2023-03-20T08:17:17Z")

</div>

The `switch` node does not change anything in the msg object. You would need a `change` node after it attached to the output of the `switch` node.

I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

---

<div class="post-metadata">

**Author:** ![GoldD](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@GoldD](https://discourse.nodered.org/u/GoldD)\
**Post date:** [20 March 2023 08:20 UTC](https://discourse.nodered.org/t/can-the-value-of-the-switch-node-which-is-20-be-entered-and-applied-from-the-ui/76730/3 "2023-03-20T08:20:31Z")

</div>

thank you so much

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [20 March 2023 08:43 UTC](https://discourse.nodered.org/t/can-the-value-of-the-switch-node-which-is-20-be-entered-and-applied-from-the-ui/76730/4 "2023-03-20T08:43:41Z")

</div>

You can use a change node to set a context variable for example flow.myvalue.  
Then the switch can compare with the context variable  
 ![Untitled 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/9/a90f54a9bc1f80096bc87998329139c28e48762f.jpeg)

---

<div class="post-metadata">

**Author:** ![GoldD](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@GoldD](https://discourse.nodered.org/u/GoldD)\
**Post date:** [23 March 2023 01:27 UTC](https://discourse.nodered.org/t/can-the-value-of-the-switch-node-which-is-20-be-entered-and-applied-from-the-ui/76730/5 "2023-03-23T01:27:13Z")

</div>

You solved my problem. Thank you.

---

<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:** [6 April 2023 01:28 UTC](https://discourse.nodered.org/t/can-the-value-of-the-switch-node-which-is-20-be-entered-and-applied-from-the-ui/76730/6 "2023-04-06T01:28:11Z")

</div>

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