# JSON Array Filtering - Function Node

**URL:** https://discourse.nodered.org/t/json-array-filtering-function-node/42827
**Category:** General
**Created:** [18 March 2021 15:26 UTC](https://discourse.nodered.org/t/json-array-filtering-function-node/42827 "2021-03-18T15:26:41Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [18 March 2021 15:47 UTC](https://discourse.nodered.org/t/json-array-filtering-function-node/42827/2 "2021-03-18T15:47:49Z")

</div>

See this post from earlier today which asks an almost identical question. [Filter Array of Objects](https://discourse.nodered.org/t/filter-array-of-objects/42808)

**[Edit]** Note that if you are using the filter function you have to call filter on the Array, which is msg.payload.trains, not msg.payload.CA\_MSG, and you have to check for equality (at least I assume that is what you want) so the test is `el.area_id === "RT")`

**[Edit]** as pointed out below that should be `el.CA_MSG.area_id`

---

_[View the full topic](https://discourse.nodered.org/t/json-array-filtering-function-node/42827)._
