# Range node requested action "Scale and drop message outside input range"

**URL:** https://discourse.nodered.org/t/range-node-requested-action-scale-and-drop-message-outside-input-range/69772
**Category:** Feature Requests
**Created:** [29 October 2022 14:44 UTC](https://discourse.nodered.org/t/range-node-requested-action-scale-and-drop-message-outside-input-range/69772 "2022-10-29T14:44:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mrdvt92](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrdvt92/32/33122_2.png) [@mrdvt92](https://discourse.nodered.org/u/mrdvt92)
#### Post date: [29 October 2022 14:44 UTC](https://discourse.nodered.org/t/range-node-requested-action-scale-and-drop-message-outside-input-range/69772/1 "2022-10-29T14:44:24Z")

</div>

I believe that using the range node to drop out of bounds data would be a great addition to the node capability. I find that I need this capability often but there is no easy way to implement this capability without work arounds.

Workaround 1: switch node with "otherwise" passthrough.

> [{"id":"c25f532d.1f40a","type":"switch","z":"205d0e6a.aaefc2","name":"between 8-23","property":"myhour","propertyType":"msg","rules":[{"t":"lt","v":"8","vt":"num"},{"t":"gte","v":"23","vt":"num"},{"t":"else"}],"checkall":"false","repair":false,"outputs":3,"x":1720,"y":280,"wires":[,,["a5b05817.d3dd08"]]}]

Workaround 2: switch node with JSONata with logic

> [{"id":"237febe9.75d584","type":"switch","z":"205d0e6a.aaefc2","name":"between 8-23","property":"payload","propertyType":"msg","rules":[{"t":"jsonata\_exp","v":"payload \>= 8 and payload \< 23","vt":"jsonata"}],"checkall":"false","repair":false,"outputs":1,"x":1740,"y":380,"wires":[]}]

Proposal: add action "drop": "Scale and drop message outside input range"

> [{"id":"7dd8b6b0.7a2f38","type":"range","z":"205d0e6a.aaefc2","minin":"8","maxin":"23","minout":"8","maxout":"23","action":"drop","round":false,"property":"payload","name":"between 8-23 (proposed)","x":1980,"y":100,"wires":[]}]

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [29 October 2022 15:42 UTC](https://discourse.nodered.org/t/range-node-requested-action-scale-and-drop-message-outside-input-range/69772/2 "2022-10-29T15:42:13Z")

</div>

Nice idea - will look at adding that.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [29 October 2022 16:46 UTC](https://discourse.nodered.org/t/range-node-requested-action-scale-and-drop-message-outside-input-range/69772/3 "2022-10-29T16:46:41Z")

</div>

PR created at - [Add drop mode to range node by dceejay · Pull Request #3935 · node-red/node-red · GitHub](https://github.com/node-red/node-red/pull/3935)

---

<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: [28 December 2022 16:47 UTC](https://discourse.nodered.org/t/range-node-requested-action-scale-and-drop-message-outside-input-range/69772/4 "2022-12-28T16:47:04Z")

</div>

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