# Display multi payload with same template

**URL:** https://discourse.nodered.org/t/display-multi-payload-with-same-template/9338
**Category:** General
**Created:** [22 March 2019 22:32 UTC](https://discourse.nodered.org/t/display-multi-payload-with-same-template/9338 "2019-03-22T22:32:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hebergeweb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hebergeweb/32/6394_2.png) [@hebergeweb](https://discourse.nodered.org/u/hebergeweb)
#### Post date: [22 March 2019 22:32 UTC](https://discourse.nodered.org/t/display-multi-payload-with-same-template/9338/1 "2019-03-22T22:32:21Z")

</div>

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?

 ![Untitled](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4bd8a9fce3d0f0e5574de82ff9de053c35368edf.png)

---

<div class="post-metadata">

### Author: ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)
#### Post date: [22 March 2019 22:41 UTC](https://discourse.nodered.org/t/display-multi-payload-with-same-template/9338/2 "2019-03-22T22:41:52Z")

</div>

I hope the little bit of reading help you out here [https://nodered.org/docs/user-guide/messages](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

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [22 March 2019 22:48 UTC](https://discourse.nodered.org/t/display-multi-payload-with-same-template/9338/3 "2019-03-22T22:48:25Z")

</div>

@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.

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [22 March 2019 22:54 UTC](https://discourse.nodered.org/t/display-multi-payload-with-same-template/9338/4 "2019-03-22T22:54:04Z")

</div>

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](https://nodered.org/docs/writing-functions#multiple-messages) ) - which is useful to know about - but not what you require here.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [23 March 2019 10:36 UTC](https://discourse.nodered.org/t/display-multi-payload-with-same-template/9338/5 "2019-03-23T10:36:57Z")

</div>

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