forwardInputMessages in UI node

Hi folks,

I'm wondering how forwardInputMessages in a UI node works.

The dashboard Switch-node has following setting:


By looking at the Switch-node (code), it is being used like this:

forwardInputMessages: config.passthru,

But when I use it like that in the node-red-contrib-ui-multistate-switch node, then it works like this:

  1. If true then all messages will be passed through
  2. if false then no messages will be passed through

However for case 1 I had expected the passthrough only to happen when the payload triggers a new state? But now the msg is also passed through when the switch doesn't change state...

I don't see anything extra that I should do to make it behave like that...


The config text and the help text for the ui_switch are misleading. It either passes through or it doesn't. Simple as that. In addition, If the payload matches one of the switch states, then it sets the switch, if not it doesn't set the switch.

Hey Colin,
Thanks a lot for your explanation!

In fact they are plain wrong really. I keep meaning to do a PR to improve them but haven't got round to it.

Do you mean that you want that the input msg should only be forwarded when the state changes, like the checkbox label describes?

No, sorry, I should have been clearer. The operation is perfect, it is the the dialog and help text that need sorting.


Link to previous discussion - Switch node - what is point of Show State of Output option?

1 Like

Ah yes, what I said is not quite true. When in non-pass through mode, if the node is set to Show State of Output then the incoming message does not set the state of the switch, but may affect other attributes of the switch.

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