# Enabling / disabling writing data to a file using a dashboard switch node

**URL:** <https://discourse.nodered.org/t/enabling-disabling-writing-data-to-a-file-using-a-dashboard-switch-node/55438>\
**Category:** General\
**Tags:** node-red-dashboard, function-node\
**Created:** [19 December 2021 15:41 UTC](https://discourse.nodered.org/t/enabling-disabling-writing-data-to-a-file-using-a-dashboard-switch-node/55438 "2021-12-19T15:41:52Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [19 December 2021 16:04 UTC](https://discourse.nodered.org/t/enabling-disabling-writing-data-to-a-file-using-a-dashboard-switch-node/55438/6 "2021-12-19T16:04:52Z")

</div>

> [@nosered1966](#):
>
> Viele Wege führen nach Rom

We in UK also use "Many roads lead to Rome"

NOTE: I recommend the 2nd option in this thread: [Cancel inputs for a period of time - #6 by Steve-Mcl](https://discourse.nodered.org/t/cancel-inputs-for-a-period-of-time/43749/6) - because I can help you with it & it doesnt use contrib nodes.

If you were to use that ↑ demo then you would place the `gate` in series between the `function` and `file` node to block / allow the flow of messages. And instead of injects to control the `gate`, use your dashboard switch to send the necessary values to "flip" the gate open / closed.

---

_[View the full topic](https://discourse.nodered.org/t/enabling-disabling-writing-data-to-a-file-using-a-dashboard-switch-node/55438)._
