# Exact behavior of 'If msg arrives on input, emulate a button click' for (new) dashboard 2.0 buttons?

**URL:** <https://discourse.nodered.org/t/exact-behavior-of-if-msg-arrives-on-input-emulate-a-button-click-for-new-dashboard-2-0-buttons/101868>\
**Category:** Dashboard\
**Created:** [8 October 2026 04:36 UTC](https://discourse.nodered.org/t/exact-behavior-of-if-msg-arrives-on-input-emulate-a-button-click-for-new-dashboard-2-0-buttons/101868 "2026-10-08T04:36:34Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jibun-no-Kage](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jibun-no-kage/32/99316_2.png) [@Jibun-no-Kage](https://discourse.nodered.org/u/Jibun-no-Kage)\
**Post date:** [8 October 2026 04:36 UTC](https://discourse.nodered.org/t/exact-behavior-of-if-msg-arrives-on-input-emulate-a-button-click-for-new-dashboard-2-0-buttons/101868/1 "2026-10-08T04:36:35Z")

</div>

As I recall, in the old dashboard, if I sent a message without a 'payload' the given button would not fire. Such that sending... Not generate a click...

msg = {  
enabled:false  
}

Would disable the button. Of course, this would enable (it again)... Not generate a click...  
msg = {  
enabled:false  
}

But the following would not only enable the button, but generate a click...  
msg = {  
enabled:false  
payload: [Whatever]  
}

Is this still the logic?

---

<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:** [8 October 2026 06:40 UTC](https://discourse.nodered.org/t/exact-behavior-of-if-msg-arrives-on-input-emulate-a-button-click-for-new-dashboard-2-0-buttons/101868/2 "2026-10-08T06:40:00Z")

</div>

I am not at my pc, but I believe it should only generate a click if the payload is present and matches one of the on/off values configured in the node. Are you seeing something different?

[Edit, no, that is for a switch of course. What do the docs say?]

---

<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:** [8 October 2026 08:26 UTC](https://discourse.nodered.org/t/exact-behavior-of-if-msg-arrives-on-input-emulate-a-button-click-for-new-dashboard-2-0-buttons/101868/3 "2026-10-08T08:26:40Z")

</div>

Having tested it then it does seem that any message will generate a click event, which _is_ what the docs say. Personally I think that if the message only includes properties such as enabled or ui\_update that it should not generate a click, but it could be argued that that would be a breaking change.  
I have never used emulate click event, if I want something to have the same action as a click then I just wire it round the button and straight into the following node.

I think it would be worth [submitting an issue against the dashboard](https://github.com/FlowFuse/node-red-dashboard/issues) to see what the response is.

---

<div class="post-metadata">

**Author:** ![Jibun-no-Kage](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jibun-no-kage/32/99316_2.png) [@Jibun-no-Kage](https://discourse.nodered.org/u/Jibun-no-Kage)\
**Post date:** [8 October 2026 15:33 UTC](https://discourse.nodered.org/t/exact-behavior-of-if-msg-arrives-on-input-emulate-a-button-click-for-new-dashboard-2-0-buttons/101868/4 "2026-10-08T15:33:37Z")

</div>

Generated the issue/request [Allow disable or enable of control, even when click message pass-thru is enabled? · Issue #2288 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/issues/2288)

Hope it is accepted!

---

<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:** [8 October 2026 15:59 UTC](https://discourse.nodered.org/t/exact-behavior-of-if-msg-arrives-on-input-emulate-a-button-click-for-new-dashboard-2-0-buttons/101868/5 "2026-10-08T15:59:21Z")

</div>

I think it would be a good idea to edit the title of the issue to make clear that it is related to the button widget.

---

<div class="post-metadata">

**Author:** ![Jibun-no-Kage](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jibun-no-kage/32/99316_2.png) [@Jibun-no-Kage](https://discourse.nodered.org/u/Jibun-no-Kage)\
**Post date:** [9 October 2026 03:34 UTC](https://discourse.nodered.org/t/exact-behavior-of-if-msg-arrives-on-input-emulate-a-button-click-for-new-dashboard-2-0-buttons/101868/6 "2026-10-09T03:34:49Z")

</div>

That is a valid point... updated the issue.

---

<div class="post-metadata">

**Author:** ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)\
**Post date:** [9 October 2026 08:53 UTC](https://discourse.nodered.org/t/exact-behavior-of-if-msg-arrives-on-input-emulate-a-button-click-for-new-dashboard-2-0-buttons/101868/7 "2026-10-09T08:53:34Z")

</div>

Not sure whether I get the full gist of your intended use, but I have a possible similar scenario where I need a dashboard 2 switch to be visually responsive to an input but not to pass through input msg, or on other times to pass through the input msg, while at all times it is responsive control from the dashboard.

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

```auto
// Passthru ON
msg._block_passthru = false;
return msg;

```

```auto
//Passthru OFF
msg._block_passthru = true;
return msg;

```

and for the _Passthru Filter_

```auto
// Allow dashboard-originated messages
if (msg._client) {
    return msg;
}

// Block messages where passthru is OFF
if (msg._block_passthru === true) {
    return null;
}

// Allow everything else
return msg;

```

Hope this helps.

---

<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:** [9 October 2026 09:28 UTC](https://discourse.nodered.org/t/exact-behavior-of-if-msg-arrives-on-input-emulate-a-button-click-for-new-dashboard-2-0-buttons/101868/8 "2026-10-09T09:28:26Z")

</div>

The use case is to normally emulate a button click when a message is passed in, but be able to enable or disable the button without emulating a click.

---

<div class="post-metadata">

**Author:** ![PdeJ](https://avatars.discourse-cdn.com/v4/letter/p/c89c15/32.png) [@PdeJ](https://discourse.nodered.org/u/PdeJ)\
**Post date:** [9 October 2026 12:45 UTC](https://discourse.nodered.org/t/exact-behavior-of-if-msg-arrives-on-input-emulate-a-button-click-for-new-dashboard-2-0-buttons/101868/9 "2026-10-09T12:45:57Z")

</div>

Of course it depends on the scenario, in my situation I wanted to reset a dashboard 2 switch as a result of a failed outcome from using the switch, but the reset msg should also not pass further along the flow path.  
The ability to inactivate the pass thru of the switch would also have been useful for my situation, but the work around of controlling the pass thru outcome was a suitable alternative.
