What is wrong with this function code?

From everything I've been able to find this code in a function in a subflow should produce 2 output connectors, the 2nd for the subflow status to connect to. But there is only 1 connector.

if (isNaN(msg.payload)) {
    node.warn("Input is NaN");
    msg.payload = "";
} else {
    msg.payload = ((msg.payload * 9 / 5.0) + 32).toFixed(1)
}
let statusMsg = { fill: "green", shape: "dot", text: "`${msg.payload.toString}°F`" };
var newMsg = { payload: statusMsg };
return [msg, newMsg];

Yes, I know that the construction of statusMsg is probably wrong but first things first.

You have to increase the number of outputs in the function node.

1 Like

Thank you!!! Didn't even think to look in there.

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