# Filtering with the switch node

**URL:** https://discourse.nodered.org/t/filtering-with-the-switch-node/64229
**Category:** General
**Tags:** node-red-dashboard
**Created:** [22 June 2022 08:28 UTC](https://discourse.nodered.org/t/filtering-with-the-switch-node/64229 "2022-06-22T08:28:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![noob69](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@noob69](https://discourse.nodered.org/u/noob69)
#### Post date: [22 June 2022 08:28 UTC](https://discourse.nodered.org/t/filtering-with-the-switch-node/64229/1 "2022-06-22T08:28:12Z")

</div>

Hi, I need to filter out according to it's msg.ocpp.command property. Can I use switch node for that? I tried with the switch node already but it passing the message through 1st outlet even the conditon is not satisfied? What is causing this behaviour?

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

---

<div class="post-metadata">

### Author: ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)
#### Post date: [22 June 2022 08:53 UTC](https://discourse.nodered.org/t/filtering-with-the-switch-node/64229/2 "2022-06-22T08:53:13Z")

</div>

Can you use use the message that's feed in this node?

---

<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: [22 June 2022 09:16 UTC](https://discourse.nodered.org/t/filtering-with-the-switch-node/64229/3 "2022-06-22T09:16:25Z")

</div>

Show us what the message going in looks like if you feed it to a debug node. Set the debug node to Output Complete Message.

---

<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: [21 August 2022 09:16 UTC](https://discourse.nodered.org/t/filtering-with-the-switch-node/64229/4 "2022-08-21T09:16:50Z")

</div>

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