# How to log values after 15 minutes in database

**URL:** <https://discourse.nodered.org/t/how-to-log-values-after-15-minutes-in-database/16147>\
**Category:** General\
**Created:** [1 October 2019 12:36 UTC](https://discourse.nodered.org/t/how-to-log-values-after-15-minutes-in-database/16147 "2019-10-01T12:36:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maria](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Maria](https://discourse.nodered.org/u/Maria)\
**Post date:** [1 October 2019 12:36 UTC](https://discourse.nodered.org/t/how-to-log-values-after-15-minutes-in-database/16147/1 "2019-10-01T12:36:29Z")

</div>

![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/7987ed95b224aab458b1b2898597c42e344745d2.png)  
I am using this flow to log values in database. I receiving data every 2 seconds but i want to log it after every 15 minutes. I tried many nodes but nothing worth it.  
Your kind help is needed.

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [1 October 2019 12:39 UTC](https://discourse.nodered.org/t/how-to-log-values-after-15-minutes-in-database/16147/2 "2019-10-01T12:39:40Z")

</div>

Am I understanding it correctly that you would like to buffer the incoming data and save it after 15 minutes of waiting? Or just save data every 15 minutes, regardless of how long it has been waiting for?  
Take a look at the builtin `delay` and `trigger` nodes to see if they can do what you're looking for.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [1 October 2019 12:40 UTC](https://discourse.nodered.org/t/how-to-log-values-after-15-minutes-in-database/16147/3 "2019-10-01T12:40:54Z")

</div>

What exactly are you doing in each of the function nodes?

---

<div class="post-metadata">

**Author:** ![Maria](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Maria](https://discourse.nodered.org/u/Maria)\
**Post date:** [1 October 2019 12:40 UTC](https://discourse.nodered.org/t/how-to-log-values-after-15-minutes-in-database/16147/4 "2019-10-01T12:40:59Z")

</div>

I just want to save data after every 15 minutes

---

<div class="post-metadata">

**Author:** ![Maria](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Maria](https://discourse.nodered.org/u/Maria)\
**Post date:** [1 October 2019 12:47 UTC](https://discourse.nodered.org/t/how-to-log-values-after-15-minutes-in-database/16147/5 "2019-10-01T12:47:14Z")

</div>

I am getting data controller using mqtt node and that data is in JSON form. I decoded the JSON using its node and after that i used functions to write queries to insert it in database and connect it to database. Data is coming every 2 second and it is inserting it as well but i want to log it after every 15 minutes. I hope you get my point

---

<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:** [1 October 2019 13:35 UTC](https://discourse.nodered.org/t/how-to-log-values-after-15-minutes-in-database/16147/6 "2019-10-01T13:35:50Z")

</div>

Did you look at the Delay node as suggested? You can use it in Rate Limit mode with Drop Intermediate Messages. Then it will only let through messages every 15 minutes.

---

<div class="post-metadata">

**Author:** ![Maria](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@Maria](https://discourse.nodered.org/u/Maria)\
**Post date:** [2 October 2019 04:02 UTC](https://discourse.nodered.org/t/how-to-log-values-after-15-minutes-in-database/16147/7 "2019-10-02T04:02:51Z")

</div>

Thank You. It works for me.
