FlowFuse / FlowFuse/node-red-dashboard

Multiple outputs capability on ui-template

Open
#433 0 comments 0 reactions 0 assignees View on GitHub
needs-triage size:M type:feature
Dominant language
HTML
Stars
355
Forks
82
Avg merge
4d 23h
Merged PRs (30d)
24

Description

### 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](https://nodered.org/docs/user-guide/writing-functions#sending-messages-asynchronously):
```
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](https://github.com/FlowFuse/node-red-dashboard/assets/44235289/07ff707f-beda-495b-9fbf-dec96d4fa276)

![image](https://github.com/FlowFuse/node-red-dashboard/assets/44235289/3232f83b-51e7-406e-bc81-b2836c2e04b6)

![chrome_BQMKCHCEQJ](https://github.com/FlowFuse/node-red-dashboard/assets/44235289/474df9b5-3a23-46f2-aef6-261b2ed6152f)

First raised [here](https://discourse.nodered.org/t/ui-template-feedback-thoughts/83579/3?u=steve-mcl) and discussed in following posts.

### Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.