# Switch node default check all conditions

**URL:** https://discourse.nodered.org/t/switch-node-default-check-all-conditions/73329
**Category:** Feature Requests
**Created:** [7 January 2023 13:49 UTC](https://discourse.nodered.org/t/switch-node-default-check-all-conditions/73329 "2023-01-07T13:49:19Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)
#### Post date: [7 January 2023 13:49 UTC](https://discourse.nodered.org/t/switch-node-default-check-all-conditions/73329/1 "2023-01-07T13:49:19Z")

</div>

Hi There!

A couple of times now I've had a weird errors because I make the wrong assumption that the switch-node stops after the first match - by default. Unfortunately it checks all conditions and does all true conditions by default ...

Is there a way to change that default to be stop after the first match? For me, a switch is a switch statement which (in most languages) stops after the first match - hence my confusion.

Which brings me to another question (sorry if I'm repeating others here): I would really like to define my own set of nodes but simply as existing nodes with different default values. Another example is that I would like to have a debug node that logs the complete `msg` object as a default instead of just the `payload` attribute (as default).

My workaround has been to create such "modified default values nodes" in my flows and then copy and paste those nodes ,,, But I would love to have a favourites list in the side bar so that I can just drag and drop them into place.

Cheers!

---

<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: [7 January 2023 14:05 UTC](https://discourse.nodered.org/t/switch-node-default-check-all-conditions/73329/2 "2023-01-07T14:05:54Z")

</div>

> [@gregorius](#):
>
> I make the wrong assumption that the switch-node stops after the first match - by default

I am +1 for a change to the default for this. I have often thought that the default should be to stop after first match.

---

<div class="post-metadata">

### Author: ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)
#### Post date: [13 January 2023 09:35 UTC](https://discourse.nodered.org/t/switch-node-default-check-all-conditions/73329/3 "2023-01-13T09:35:59Z")

</div>

OK, deep in the darkest recesses of the menu I found what I was looking for: Subflows!

Mea culpa for not looking harder 🙂

---

<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: [14 March 2023 09:36 UTC](https://discourse.nodered.org/t/switch-node-default-check-all-conditions/73329/4 "2023-03-14T09:36:01Z")

</div>

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