# Switch Node on UI

**URL:** <https://discourse.nodered.org/t/switch-node-on-ui/31568>\
**Category:** General\
**Created:** [14 August 2020 14:14 UTC](https://discourse.nodered.org/t/switch-node-on-ui/31568 "2020-08-14T14:14:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pac8](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@Pac8](https://discourse.nodered.org/u/Pac8)\
**Post date:** [14 August 2020 14:14 UTC](https://discourse.nodered.org/t/switch-node-on-ui/31568/1 "2020-08-14T14:14:10Z")

</div>

I have a quick query that someone may have come across how to solve. I have an input coming in from a barcode scanner and i want to direct it to individual output texts on a UI.  
Is there a way to toggle or switch on and off the barcode input at specific nodes so they will be sent to designated outputs, if that makes sense??

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/d/fd1ae0d0d198dc0eb5baa9195b9af2d11f441478.png)  
I have 1 barcode scanner but wish to display 2 different lot numbers on the same ui.

thanks

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 August 2020 16:17 UTC](https://discourse.nodered.org/t/switch-node-on-ui/31568/2 "2020-08-14T16:17:55Z")

</div>

how do you tell them apart ? What can you use to direct them ?

---

<div class="post-metadata">

**Author:** ![Pac8](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@Pac8](https://discourse.nodered.org/u/Pac8)\
**Post date:** [14 August 2020 16:44 UTC](https://discourse.nodered.org/t/switch-node-on-ui/31568/3 "2020-08-14T16:44:45Z")

</div>

I have them in different groups on in the UI. I have tried renaming them with no joy. I tried using a switch(UI) node but that only sends true/false values.  
Im not sure if it can be done without using some kind of mqtt setup but want to try keep it locally on 1 device inside of importing alot of needless signal.s  
I have tried using toggles, routing, switch and change nodes but i need to be able to select on the UI which data is populated ie job 1 or job 2.

---

<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:** [14 August 2020 16:59 UTC](https://discourse.nodered.org/t/switch-node-on-ui/31568/4 "2020-08-14T16:59:28Z")

</div>

Add a button in each group

Have the buttons set a flow variable to 1 or 2

When the barcode is read, use a switch node to look at the flow variable. Go down path 1 if `1` else.... (You get the idea)

Note. I am assuming the scanner connects to the backend (to node-red side) and causes a msg to be sent.

---

<div class="post-metadata">

**Author:** ![Pac8](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@Pac8](https://discourse.nodered.org/u/Pac8)\
**Post date:** [14 August 2020 17:11 UTC](https://discourse.nodered.org/t/switch-node-on-ui/31568/5 "2020-08-14T17:11:05Z")

</div>

Barcode scanner connected to Siemens IoT2020 and being read fine in node red with msg.payload.  
I want to give the user the option of selecting which job to populate with the barcode scan, thats why i was trying the switch butoon onscreen in the UI.

---

<div class="post-metadata">

**Author:** ![Pac8](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@Pac8](https://discourse.nodered.org/u/Pac8)\
**Post date:** [15 August 2020 09:18 UTC](https://discourse.nodered.org/t/switch-node-on-ui/31568/6 "2020-08-15T09:18:56Z")

</div>

Got sorted here, thanks everyone.

2 UI switches going to individual switch nodes and running flow.state, on barcode scan to 2 change nodes looking for flow states. The UI switches when true determine which group in populated with the barcode scan.

---

<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:** [29 August 2020 09:18 UTC](https://discourse.nodered.org/t/switch-node-on-ui/31568/7 "2020-08-29T09:18:57Z")

</div>

Closed on 29 August 2020 09:18 UTC

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