# Pass over msg.payload to html

**URL:** https://discourse.nodered.org/t/pass-over-msg-payload-to-html/14828
**Category:** Developing Nodes
**Created:** [27 August 2019 17:07 UTC](https://discourse.nodered.org/t/pass-over-msg-payload-to-html/14828 "2019-08-27T17:07:29Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![matthiasertl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/matthiasertl/32/11401_2.png) [@matthiasertl](https://discourse.nodered.org/u/matthiasertl)
#### Post date: [27 August 2019 17:07 UTC](https://discourse.nodered.org/t/pass-over-msg-payload-to-html/14828/1 "2019-08-27T17:07:29Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e87ca7708488428b29bef6362b5cceb7f82f2047.png)

im trying topass over the answer from my modbus reader to a html page which i can read with my samsung smartthings device.

the debug on the modbus reader shows my so called PV Power Value (e.g. [1223])  
but i can not pass the value over to html page

```auto
[{"id":"509fe3f3.ed4fcc","type":"modbus-read","z":"b674ccb9.e4634","name":"PV Leistung in Watt","topic":"","showStatusActivities":false,"showErrors":false,"unitid":"1","dataType":"HoldingRegister","adr":"40067","quantity":"1","rate":"5","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"2a37966f.8a7eea","x":165,"y":197.3088870048523,"wires":[["9defc885.442278","16de300a.4bf8f"],[]]},{"id":"42f0b148.f4ea1","type":"http in","z":"b674ccb9.e4634","name":"","url":"/bbat","method":"get","upload":false,"swaggerDoc":"","x":249.43756103515625,"y":363.99999237060547,"wires":[["16de300a.4bf8f"]]},{"id":"16de300a.4bf8f","type":"template","z":"b674ccb9.e4634","name":"page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"","output":"str","x":435.4375648498535,"y":317.0000009536743,"wires":[["f0b63f49.4071f","26b0f85f.2a7ab8"]]},{"id":"f0b63f49.4071f","type":"change","z":"b674ccb9.e4634","name":"Set Headers","rules":[{"t":"set","p":"headers","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"headers.content-type","pt":"msg","to":"application/json","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":599.4375610351562,"y":363.99999237060547,"wires":[["f92e563e.932688"]]},{"id":"f92e563e.932688","type":"http response","z":"b674ccb9.e4634","name":"","x":759.4375610351562,"y":363.99999237060547,"wires":[]},{"id":"26b0f85f.2a7ab8","type":"debug","z":"b674ccb9.e4634","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":613.4375686645508,"y":224,"wires":[]},{"id":"9defc885.442278","type":"ui_text","z":"b674ccb9.e4634","group":"31d27e.7e2f7d82","order":0,"width":0,"height":0,"name":"","label":"text","format":"{{msg.payload}}","layout":"row-spread","x":399.0376205444336,"y":132,"wires":[]},{"id":"2a37966f.8a7eea","type":"modbus-client","z":"","name":"E3DC S10 Hauskraftwerk","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":true,"tcpHost":"192.168.178.60","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectTimeout":"2000"},{"id":"31d27e.7e2f7d82","type":"ui_group","z":"","name":"Default","tab":"adb4fc7c.30a73","disp":true,"width":"6","collapse":false},{"id":"adb4fc7c.30a73","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<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: [27 August 2019 17:16 UTC](https://discourse.nodered.org/t/pass-over-msg-payload-to-html/14828/2 "2019-08-27T17:16:36Z")

</div>

Hi and welcome to the forum.

Just a note, Not everyone will install morbus nodes to test your flow. And it's even more unlikely they will have the same device to get data from.

You are more likely to get assistance if you provide a flow with various injects that simulate the data.

You can easily achieve this by using the copy button from the debug output, put the result into JSON payload in the inject and press it. If you get the same format data in the debug window as the data from your morbus device, then paste that flow (minus the morbus stuff).

Anyhow, I think you might as this yourself. Have a read of [this](https://nodered.org/docs/user-guide/messages). It has invaluable information to help you "get it"

---

<div class="post-metadata">

### Author: ![matthiasertl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/matthiasertl/32/11401_2.png) [@matthiasertl](https://discourse.nodered.org/u/matthiasertl)
#### Post date: [27 August 2019 17:30 UTC](https://discourse.nodered.org/t/pass-over-msg-payload-to-html/14828/3 "2019-08-27T17:30:08Z")

</div>

Hi,

sorry, i didnt get you ... if i understand you right i must copy the debug outlut (e.g. [1233]) to inject node ?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/845cc0aa45355bc32d7751bbc76aa7317a12481f.png)

this is my output from modbus ...

and this value (248) i want to pass over to html ?

im not an it guy - i already read the link you provided .. sorry my stupid question and bad english and thank you so much for your help !

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [27 August 2019 17:37 UTC](https://discourse.nodered.org/t/pass-over-msg-payload-to-html/14828/4 "2019-08-27T17:37:46Z")

</div>

Your value:

> array[1]

As per documentation, example:

> - Array - `[1,2,3,4]`

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

> `payload.Phone[2].type`

Can you fill in the blanks ?

---

<div class="post-metadata">

### Author: ![matthiasertl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/matthiasertl/32/11401_2.png) [@matthiasertl](https://discourse.nodered.org/u/matthiasertl)
#### Post date: [27 August 2019 17:44 UTC](https://discourse.nodered.org/t/pass-over-msg-payload-to-html/14828/5 "2019-08-27T17:44:57Z")

</div>

this must be

> msg.payload[0]

how can i output that now on html ?

---

<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: [27 August 2019 17:46 UTC](https://discourse.nodered.org/t/pass-over-msg-payload-to-html/14828/6 "2019-08-27T17:46:49Z")

</div>

Use a dashboard label  
Or  
Use a ui\_template node

They both have built in instructions. Give it a go.

You may need to drop the `msg.` part.

---

<div class="post-metadata">

### Author: ![matthiasertl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/matthiasertl/32/11401_2.png) [@matthiasertl](https://discourse.nodered.org/u/matthiasertl)
#### Post date: [27 August 2019 17:52 UTC](https://discourse.nodered.org/t/pass-over-msg-payload-to-html/14828/7 "2019-08-27T17:52:28Z")

</div>

i must have the value provided within a GET Request ... iam requesting ip/bbat and log /use the whole $response

i dropped msg.  
now i get

> [object Object]

---

<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: [27 August 2019 18:05 UTC](https://discourse.nodered.org/t/pass-over-msg-payload-to-html/14828/8 "2019-08-27T18:05:21Z")

</div>

Ah ok. So...

You'll have to store the value somewhere ready for the GET request. Connect your morbus output to a change node and set a flow variable e.g. flow.data from msg.payload[0]. That will keep a copy.

Next add a http in and out node with a change node between them setting msg.payload from flow.data.

---

<div class="post-metadata">

### Author: ![matthiasertl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/matthiasertl/32/11401_2.png) [@matthiasertl](https://discourse.nodered.org/u/matthiasertl)
#### Post date: [27 August 2019 18:18 UTC](https://discourse.nodered.org/t/pass-over-msg-payload-to-html/14828/9 "2019-08-27T18:18:50Z")

</div>

it works with your hint ! thank you so much ! ive been working on this since weeks 😜 ... i will showyou my result later !
