Returning TWO msg.payloads?

New problem.

(Of course)

With new knowledge I am re-writing a lot of my flows to simplify things. Or so I hope.

I have a “node” that detects if things are good or bad.
If good, all is … good.

If bad, it sends ONE message to wipe data from being displayed on Gauges and Charts.

And there is the problem.

To wipe a Gauge, I have to send it 0.
To wipe a Chart I have to send it NULL.

To cut down on nodes and types of nodes, I have one.
(Function block.)

if (msg.topic === 'RESET')
{
    //
    msg.payload = '0';
    return msg;
}
return msg;

I don’t know if I am getting “carried away” with this style of thinking or what, but please indulge me.

Alas that wipes Gauges, but not Charts (or graphs as I call them).
They need a NULL.

Is it I shall have to make a second version of this that sends msg.payload = [] rather than 0, or can I send two payloads?
Or make two outputs?

Sorry, something is happening and it needs further investigation.

You cannot return more than once from a function. Once you return the function stops.

The documentation covers how to send multiple messages from a function, as well as how to send messages without using return.

https://nodered.org/docs/writing-functions

True,

But I did get around it with the trigger node.

So the problem as it is/was have been resolved.