# How to discard first message(s) and pass only the last message in a set period of time?

**URL:** https://discourse.nodered.org/t/how-to-discard-first-message-s-and-pass-only-the-last-message-in-a-set-period-of-time/74570
**Category:** General
**Created:** [1 February 2023 19:38 UTC](https://discourse.nodered.org/t/how-to-discard-first-message-s-and-pass-only-the-last-message-in-a-set-period-of-time/74570 "2023-02-01T19:38:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![t0mZ4](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/t0mz4/32/75439_2.png) [@t0mZ4](https://discourse.nodered.org/u/t0mZ4)
#### Post date: [1 February 2023 19:38 UTC](https://discourse.nodered.org/t/how-to-discard-first-message-s-and-pass-only-the-last-message-in-a-set-period-of-time/74570/1 "2023-02-01T19:38:54Z")

</div>

Hi 🙂

Any idea on how to achieve the following case?

for topic A:  
in a window of 5 seconds  
Message A - delete  
Message B - delete  
Message C (last message) - pass

thanks champions!

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [1 February 2023 19:54 UTC](https://discourse.nodered.org/t/how-to-discard-first-message-s-and-pass-only-the-last-message-in-a-set-period-of-time/74570/2 "2023-02-01T19:54:07Z")

</div>

Trigger node...

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

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [1 February 2023 20:06 UTC](https://discourse.nodered.org/t/how-to-discard-first-message-s-and-pass-only-the-last-message-in-a-set-period-of-time/74570/3 "2023-02-01T20:06:15Z")

</div>

I think that extend delay should be unchecked if the window is 5 seconds.

---

<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: [2 April 2023 20:06 UTC](https://discourse.nodered.org/t/how-to-discard-first-message-s-and-pass-only-the-last-message-in-a-set-period-of-time/74570/4 "2023-04-02T20:06:41Z")

</div>

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