node-red-dashboard icon indicating copy to clipboard operation
node-red-dashboard copied to clipboard

Multiple outputs capability on ui-template

Open Steve-Mcl opened this issue 2 years ago • 0 comments

Description

As a template node can have multiple components, currently, the only way to pass multiple payloads from the front end to the backend is via the single output of the template node. This leads to duplication at both ends: in client side, you have to do extra work to "tag" the message (typically setting a topic) then at server side you have to route the messages (typically via a switch or function node).

Having a numeric spinner to permit the user to set multiple outputs, the send functionality (that the function node employs) permits messages to target a specific output. Additionally, as an added bonus, this then permits the user to name the outputs (free, existing functionality) making for better comprehension.

Adapted from the docs:

const msg1 = { payload:"first out of output 1" };
const msg2 = { payload:"second out of output 1" };
const msg3 = { payload:"third out of output 1" };
const msg4 = { payload:"only message from output 2" };
send ([ [ msg1, msg2, msg3 ], msg4 ]);

Function node example

image

image

chrome_BQMKCHCEQJ

First raised here and discussed in following posts.

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

Steve-Mcl avatar Dec 12 '23 10:12 Steve-Mcl