# Use a button on dashboard to control inject node

**URL:** <https://discourse.nodered.org/t/use-a-button-on-dashboard-to-control-inject-node/84799>\
**Category:** General\
**Created:** [22 January 2024 13:05 UTC](https://discourse.nodered.org/t/use-a-button-on-dashboard-to-control-inject-node/84799 "2024-01-22T13:05:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![flipside](https://avatars.discourse-cdn.com/v4/letter/f/c6cbf5/32.png) [@flipside](https://discourse.nodered.org/u/flipside)\
**Post date:** [22 January 2024 13:05 UTC](https://discourse.nodered.org/t/use-a-button-on-dashboard-to-control-inject-node/84799/1 "2024-01-22T13:05:49Z")

</div>

Hello!

I currently have a flow that has a function, which is running a query in a mysql database.  
I want that query to run every 10 seconds.  
Everything works fine with an inject node with a respective time interval.

My problem is that the inject node is working all the time, and the query is running continuously.  
Is it possible to have a button on dashboard, in order to start the inject node?  
My main goal is to control the time that the query (function) is going to start working, and then continue in a time interval.

Best regards.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [22 January 2024 13:09 UTC](https://discourse.nodered.org/t/use-a-button-on-dashboard-to-control-inject-node/84799/2 "2024-01-22T13:09:40Z")

</div>

Instead of `inject` use a `trigger` node  
The trigger node can be set to start, stop & repeat what was sent to it

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/9/99d38f75976222a39fcdbcf88c0a28ba5f8aad71.png)

---

<div class="post-metadata">

**Author:** ![flipside](https://avatars.discourse-cdn.com/v4/letter/f/c6cbf5/32.png) [@flipside](https://discourse.nodered.org/u/flipside)\
**Post date:** [22 January 2024 13:18 UTC](https://discourse.nodered.org/t/use-a-button-on-dashboard-to-control-inject-node/84799/3 "2024-01-22T13:18:48Z")

</div>

Hello Marcus.

Thank you for your quick response.  
Works great!  
I can now start and stop the query from the dashboard.

Best regards.

---

<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:** [5 February 2024 13:19 UTC](https://discourse.nodered.org/t/use-a-button-on-dashboard-to-control-inject-node/84799/4 "2024-02-05T13:19:47Z")

</div>

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