# How to emit with 'widget-send' without updating the node's datastore?

**URL:** <https://discourse.nodered.org/t/how-to-emit-with-widget-send-without-updating-the-nodes-datastore/97653>\
**Category:** Developing Nodes\
**Tags:** dashboard-2\
**Created:** [16 June 2025 16:54 UTC](https://discourse.nodered.org/t/how-to-emit-with-widget-send-without-updating-the-nodes-datastore/97653 "2025-06-16T16:54:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)\
**Post date:** [16 June 2025 16:54 UTC](https://discourse.nodered.org/t/how-to-emit-with-widget-send-without-updating-the-nodes-datastore/97653/1 "2025-06-16T16:54:42Z")

</div>

I am developing a custom UI node for dashboard-2 and using the datastore to save the node's data image (for populating the widgets upon page open/refresh). In the datastore I'm using a proprietary data structure (with both data & meta-data), and it all works very well.

I noticed that when I send a message from the widget (in the standard way - using `emit('widget-send',...`) the message is automatically merged into my data structure in the datastore. This creates a mess (as well as a risk of corrupting my data).

I don't need the messages to be saved. Is there a way to disable this?

I tried to use `'widget-action'`, which does not affect the datastore, but it introduces another problem: it overrides the existing `msg.topic` with `undefined`.  
(I looked into the Vue code: the handler expects an event argument with a `topic` property, which is not there).

---

<div class="post-metadata">

**Author:** ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)\
**Post date:** [17 June 2025 20:19 UTC](https://discourse.nodered.org/t/how-to-emit-with-widget-send-without-updating-the-nodes-datastore/97653/2 "2025-06-17T20:19:42Z")

</div>

OK, I investigated a bit and found the solution:  
Setting `onAction` to `false` in the server node, disables the default `'widget-action'` handler (which overrides `msg.topic`), and allows me to provide my own handler where I can do whatever I want with the message - tweak it, discard it etc.  
RTFM... 🤦

---

<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:** [1 July 2025 20:19 UTC](https://discourse.nodered.org/t/how-to-emit-with-widget-send-without-updating-the-nodes-datastore/97653/3 "2025-07-01T20:19:50Z")

</div>

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