# Switch Node where cond. with more values

**URL:** <https://discourse.nodered.org/t/switch-node-where-cond-with-more-values/34495>\
**Category:** General\
**Created:** [19 October 2020 10:02 UTC](https://discourse.nodered.org/t/switch-node-where-cond-with-more-values/34495 "2020-10-19T10:02:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![denisjoshua](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@denisjoshua](https://discourse.nodered.org/u/denisjoshua)\
**Post date:** [19 October 2020 10:02 UTC](https://discourse.nodered.org/t/switch-node-where-cond-with-more-values/34495/1 "2020-10-19T10:02:34Z")

</div>

Hi there all,  
I need to tell to a Switch Node to make 2 output  
one for received "Saturday" or "Sunday"  
the second for received "Monday" or "Tuesday" or "Wednesday" or "Thursday" or "Friday"

I know that can be simple... but I can't understand how to write in this node:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/0/b09347bec211620b5d90281dfe49088e5864d5d2.png)

Anybody can help me please ?  
Thanks a lot

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [19 October 2020 11:31 UTC](https://discourse.nodered.org/t/switch-node-where-cond-with-more-values/34495/2 "2020-10-19T11:31:22Z")

</div>

There are several ways of writing this.  
One possible solution:

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

---

<div class="post-metadata">

**Author:** ![denisjoshua](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@denisjoshua](https://discourse.nodered.org/u/denisjoshua)\
**Post date:** [19 October 2020 12:15 UTC](https://discourse.nodered.org/t/switch-node-where-cond-with-more-values/34495/3 "2020-10-19T12:15:10Z")

</div>

It's work !!!  
...never think about regex...

Thanks a lot 🙂

---

<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:** [19 October 2020 12:49 UTC](https://discourse.nodered.org/t/switch-node-where-cond-with-more-values/34495/4 "2020-10-19T12:49:18Z")

</div>

If you know the global will always be setup with a day of the week then you can use Otherwise as the second test. However you might want to keep it as it is so that the message is not sent at all if the global has not yet been setup.

---

<div class="post-metadata">

**Author:** ![denisjoshua](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@denisjoshua](https://discourse.nodered.org/u/denisjoshua)\
**Post date:** [19 October 2020 13:58 UTC](https://discourse.nodered.org/t/switch-node-where-cond-with-more-values/34495/5 "2020-10-19T13:58:11Z")

</div>

Thanks a lot Colin,  
in fact I have used "else" for the second test

Thanks all  
Denis

---

<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:** [2 November 2020 13:58 UTC](https://discourse.nodered.org/t/switch-node-where-cond-with-more-values/34495/6 "2020-11-02T13:58:13Z")

</div>

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