# How do I exclude Routing for 'Closed' Notecard Session Events using JSONata Transformation

**URL:** <https://discuss.blues.com/t/how-do-i-exclude-routing-for-closed-notecard-session-events-using-jsonata-transformation/2435>\
**Category:** Notehub.io\
**Created:** [November 5, 2024, 8:35pm UTC](https://discuss.blues.com/t/how-do-i-exclude-routing-for-closed-notecard-session-events-using-jsonata-transformation/2435 "2024-11-05T20:35:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcaudillo](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@dcaudillo](https://discuss.blues.com/u/dcaudillo)\
**Post date:** [November 5, 2024, 8:35pm UTC](https://discuss.blues.com/t/how-do-i-exclude-routing-for-closed-notecard-session-events-using-jsonata-transformation/2435/1 "2024-11-05T20:35:12Z")

</div>

I would like my Notehub route to include only ‘Open’ Notecard session data and exclude ‘Closed’ session data. What type of expression should I use in the JSONata transform field to accomplish this?

---

<div class="post-metadata">

**Author:** ![dcaudillo](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@dcaudillo](https://discuss.blues.com/u/dcaudillo)\
**Post date:** [November 5, 2024, 8:38pm UTC](https://discuss.blues.com/t/how-do-i-exclude-routing-for-closed-notecard-session-events-using-jsonata-transformation/2435/2 "2024-11-05T20:38:19Z")

</div>

To exclude ‘Closed’ session data from your existing Notehub route, navigate to the **Data** section in your route settings. In the **Transform Data** dropdown, select **JSONata Expression**. In the **JSONata Expression** field, enter the following expression:

```auto
(
$result := $;
$contains(body.why, "closed") ?
$doNotRoute() : $result;
)

```
