# Multi msg.payload for dashboard template

**URL:** <https://discourse.nodered.org/t/multi-msg-payload-for-dashboard-template/17157>\
**Category:** Dashboard\
**Created:** [25 October 2019 18:43 UTC](https://discourse.nodered.org/t/multi-msg-payload-for-dashboard-template/17157 "2019-10-25T18:43:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pooyatavan](https://avatars.discourse-cdn.com/v4/letter/p/c2a13f/32.png) [@pooyatavan](https://discourse.nodered.org/u/pooyatavan)\
**Post date:** [25 October 2019 18:43 UTC](https://discourse.nodered.org/t/multi-msg-payload-for-dashboard-template/17157/1 "2019-10-25T18:43:22Z")

</div>

hi, i need help for dashboard template.  
i read this: [Msg.payload from multiple nodes to ui\_template](https://discourse.nodered.org/t/msg-payload-from-multiple-nodes-to-ui-template/3862)  
and i use join for create an array for my data and then exracted like this:  
msg.one = msg.payload[0];  
msg.two = msg.payload[1];  
and its work. but the problem is somtimes data write in 0 and somtimes write in 1.  
so how can i set a data alway set in 0 or 1  
i need i musy create object, right?  
can i create an data like object like this:  
var newMsg = {};  
newMsg.payload = {  
weather: "Rain",  
temp\_maxc: 25.5,  
temp\_minc: 18.3,  
humidity: 53,  
pressure: 1000  
}

---

<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:** [25 October 2019 19:46 UTC](https://discourse.nodered.org/t/multi-msg-payload-for-dashboard-template/17157/2 "2019-10-25T19:46:40Z")

</div>

You could use a topic in your source data  
E.g.

```auto
if( msg.topic == "something"){
  msg.one = msg.payload
} 
/Etc

```

---

<div class="post-metadata">

**Author:** ![pooyatavan](https://avatars.discourse-cdn.com/v4/letter/p/c2a13f/32.png) [@pooyatavan](https://discourse.nodered.org/u/pooyatavan)\
**Post date:** [26 October 2019 07:44 UTC](https://discourse.nodered.org/t/multi-msg-payload-for-dashboard-template/17157/3 "2019-10-26T07:44:50Z")

</div>

thank you so much.
