# \[Feature Request\]Help prevent crossing wires from Switch node

**URL:** <https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233>\
**Category:** General\
**Created:** [15 February 2023 12:02 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233 "2023-02-15T12:02:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [15 February 2023 12:02 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/1 "2023-02-15T12:02:53Z")

</div>

I've always been hoping to see the switch node gain a few extra features but things have been very quiet with it for a while now.

One issue I'd like to see resolved is some method of easily getting around this type of crossed wire situation

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/4/e46b4ccf74918190284db62cd8c97f779794db17.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/7/67f738b5cb3d9f25cb8ef7243d53f352db746d93.png)

Obviously, the switch node is a fundemental core node so changing it's behaviour needs a very cautious approach

But a couple of ideas sprung to mind today

1. Add option to label the outputs 1,2,3,4,5

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/8/985cb1aa4488a2a271766589917201b0785027e6.png)

1. Add option to reverse them

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/e/2ec57af722b55ab23e88c600dbb8aeae93c4a7cb.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 February 2023 14:41 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/2 "2023-02-15T14:41:25Z")

</div>

My feeling is that would cause more problems than it saves, due to getting confused over which way up the particular node is configured.

For the problem, I often use a Link node on the top ones to link down past the nodes attached to o/p 5.

Also, you could use a regex to send it to o/p 1 if it doesn't match any of those strings.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [15 February 2023 14:45 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/3 "2023-02-15T14:45:01Z")

</div>

> [@Colin](#):
>
> due to getting confused over which way up the particular node is configured.

That's the reason for the number labelling 🙂

And it wouldn't cause any issue for anyone who didn't tick a checkmark 🙂

> [@Colin](#):
>
> For the problem, I often use a Link node on the top ones to link down past the nodes attached to o/p 5.

I'm after NOT having to employ extra nodes

> [@Colin](#):
>
> Also, you could use a regex to send it to o/p 1 if it doesn't match any of those strings.

And now we have two problems....... 🙂

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [15 February 2023 14:53 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/4 "2023-02-15T14:53:08Z")

</div>

> [@cymplecy](#):
>
> I'm after NOT having to employ extra nodes

Why?

> [@cymplecy](#):
>
> And now we have two problems.

I think still only one problem, but it is how to code the regex (which is a one off problem, fairly easily solved), instead of the continuing annoyance at the crossing wires. I must admit that a few crossing wires doesn't bother me. In your example I would add another junction further down so there is only one crossing not two.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [15 February 2023 15:21 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/5 "2023-02-15T15:21:14Z")

</div>

> [@Colin](#):
>
> but it is how to code the regex (which is a one off problem, fairly easily solved)

You must be new here and not have dealt with me before 🙂

---

<div class="post-metadata">

**Author:** ![Sineos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sineos/32/3440_2.png) [@Sineos](https://discourse.nodered.org/u/Sineos)\
**Post date:** [15 February 2023 16:14 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/6 "2023-02-15T16:14:22Z")

</div>

In this cases I just use a Link node like a via in PCB design. 🤷‍♂️

---

<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:** [15 February 2023 16:30 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/7 "2023-02-15T16:30:33Z")

</div>

> [@Sineos](#):
>
> In this cases I just use a Link node

And with NR 3.x and above, that is nice and easy now

![chrome_4uR3BaQsoA](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/b/9b0cf6e91021ee435504d12fd5477cf93d644516.gif)

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [15 February 2023 16:35 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/8 "2023-02-15T16:35:28Z")

</div>

This thread is not about workarounding the fundamental issue 🙂

---

<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:** [15 February 2023 17:25 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/9 "2023-02-15T17:25:48Z")

</div>

you could work up the page instead of down then the top links wouldn't cross 🙂 nothing says they have to start top left.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [15 February 2023 17:27 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/10 "2023-02-15T17:27:56Z")

</div>

Get out!!!!!!!!!!

---

<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:** [15 February 2023 17:29 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/11 "2023-02-15T17:29:42Z")

</div>

I'll get my coat.... 🧥

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [15 February 2023 17:35 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/12 "2023-02-15T17:35:59Z")

</div>

As I've said - I don't need workarounds - I can easily sort myself out 🙂

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/f/cf22706043c0c84382ff269581dead1bfdeeca35.png)

---

<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:** [15 February 2023 17:44 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/13 "2023-02-15T17:44:39Z")

</div>

or simpler

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/6/c63f2c2741aa8ec18535b2f12d4222f3fc67c65f.png)  
but yeah, whatevs... 🙂 time for a 🍺

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [15 February 2023 18:08 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/14 "2023-02-15T18:08:34Z")

</div>

A rather nice red wine awaits here at Chez Knight, left-overs from Valentines Night meal. 😁

---

<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:** [15 February 2023 18:10 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/15 "2023-02-15T18:10:03Z")

</div>

When life gives you crossed wires, make onion domes:  
 ![Untitled 3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/2/d2f48350767fb7048a6a118b604e566b3e93b2ca.jpeg)

 ![Untitled 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/7/678b70874b7c4414775fec8841bca1dbeaa61322.jpeg)

---

<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:** [15 February 2023 18:20 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/16 "2023-02-15T18:20:11Z")

</div>

Indeed. More of my flows look like that than I care to admit !

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [15 February 2023 20:36 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/17 "2023-02-15T20:36:09Z")

</div>

Ah, but if only we could get those colours! Maybe in Node-RED v10?

---

<div class="post-metadata">

**Author:** ![Sineos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sineos/32/3440_2.png) [@Sineos](https://discourse.nodered.org/u/Sineos)\
**Post date:** [15 February 2023 21:06 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/18 "2023-02-15T21:06:21Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/7/87beff7a81f2d08516eff12fac1ae3475513283b.jpeg)

---

<div class="post-metadata">

**Author:** ![michaelblight](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/michaelblight/32/445_2.png) [@michaelblight](https://discourse.nodered.org/u/michaelblight)\
**Post date:** [16 February 2023 04:12 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/19 "2023-02-16T04:12:23Z")

</div>

Is it too nitpicky to say that for the specific case you've mentioned, you could move the "otherwise" to the top of the list - assuming you leave it at "checking all rules" and your "contains" doesn't match more than one.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 February 2023 09:22 UTC](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233/20 "2023-02-16T09:22:56Z")

</div>

> [@michaelblight](#):
>
> you could move the "otherwise" to the top of the list - assuming you leave it at "checking all rules" and your "contains" doesn't match more than one.

Actually that doesn't seem to work correctly, for me at least. It seems there is a bug in `otherwise`

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/6/66fd4b57232531348733e147f3d3bf79cf7d2507.png)

```auto
[{"id":"028a6eabcf716de1","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"hello","payloadType":"str","_mcu":{"mcu":false},"x":130,"y":560,"wires":[["8471bf3fb2f60286"]]},{"id":"8e9d6d71c5833b8c","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"foo","payloadType":"str","_mcu":{"mcu":false},"x":130,"y":600,"wires":[["8471bf3fb2f60286"]]},{"id":"aa01b753cadbce05","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"bar","payloadType":"str","_mcu":{"mcu":false},"x":130,"y":640,"wires":[["8471bf3fb2f60286"]]},{"id":"8471bf3fb2f60286","type":"switch","z":"bdd7be38.d3b55","name":"","property":"payload","propertyType":"msg","rules":[{"t":"else"},{"t":"cont","v":"ello","vt":"str"},{"t":"cont","v":"oo","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"_mcu":{"mcu":false},"x":310,"y":600,"wires":[["77c44f49affe1f3c"],["86e6760964d010b7"],["c1f6c9298bcb1fcc"]]},{"id":"86e6760964d010b7","type":"debug","z":"bdd7be38.d3b55","name":"TWO","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","_mcu":{"mcu":false},"x":490,"y":600,"wires":[]},{"id":"c1f6c9298bcb1fcc","type":"debug","z":"bdd7be38.d3b55","name":"THREE","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","_mcu":{"mcu":false},"x":500,"y":640,"wires":[]},{"id":"77c44f49affe1f3c","type":"debug","z":"bdd7be38.d3b55","name":"ONE","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","_mcu":{"mcu":false},"x":490,"y":560,"wires":[]}]

```

[Next page](https://discourse.nodered.org/t/feature-request-help-prevent-crossing-wires-from-switch-node/75233.md?page=2)
