# Filtering with Jsonata

**URL:** <https://discourse.nodered.org/t/filtering-with-jsonata/13693>\
**Category:** General\
**Created:** [25 July 2019 15:00 UTC](https://discourse.nodered.org/t/filtering-with-jsonata/13693 "2019-07-25T15:00:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ventzitt](https://avatars.discourse-cdn.com/v4/letter/v/94ad74/32.png) [@ventzitt](https://discourse.nodered.org/u/ventzitt)\
**Post date:** [25 July 2019 15:00 UTC](https://discourse.nodered.org/t/filtering-with-jsonata/13693/1 "2019-07-25T15:00:47Z")

</div>

For the last hours, I've been trying to filter some JSON messages and almost succeeded. However I can't get rid of (drop out) a msg that comes from the device occasionally and reports it's status.  
This is it:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f0cd844ae4e4fd2fd76526e3c5465207ba9ba931.png)  
A **picture** is **worth a thousand words**  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/aad73e0baeb3c57e94792c0599209f15ab58bb9a.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:** [25 July 2019 15:41 UTC](https://discourse.nodered.org/t/filtering-with-jsonata/13693/2 "2019-07-25T15:41:44Z")

</div>

If you just want to ignore particular messages then you can use a switch node to detect them and send them to an unused output, or reverse the logic and keep the good messages.

---

<div class="post-metadata">

**Author:** ![ventzitt](https://avatars.discourse-cdn.com/v4/letter/v/94ad74/32.png) [@ventzitt](https://discourse.nodered.org/u/ventzitt)\
**Post date:** [25 July 2019 15:49 UTC](https://discourse.nodered.org/t/filtering-with-jsonata/13693/3 "2019-07-25T15:49:01Z")

</div>

I have tried that. Switch mode two outupts but it is not working I am sure it's Me 😉

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

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [25 July 2019 16:50 UTC](https://discourse.nodered.org/t/filtering-with-jsonata/13693/4 "2019-07-25T16:50:03Z")

</div>

The error is an error coming from the node, not actual payload, you need to look at the sonoff instead.
