Display multi payload with same template

Hi,
There is an error at the function and I do not know where it is to display 2 values (payload1 and payload2) in ui_template?

I hope the little bit of reading help you out here https://nodered.org/docs/user-guide/messages
Read carefully cos this is base knowledge to understand how all of the things work here in Node-Red

1 Like

@hebergeweb Your function sets the properties payload1 and payload2 on the msg object.

It then returns the message objects msg1 and msg2 that don't exist so won't do anything.

Your function should return the msg object you have set the properties on.

1 Like

And you are returning an array of messages - that is the syntax for sending messages out via two ports
(see https://nodered.org/docs/writing-functions#multiple-messages ) - which is useful to know about - but not what you require here.

1 Like

Just change the last line to...
return msg;

1 Like