# Problem showing payload on template

**URL:** <https://discourse.nodered.org/t/problem-showing-payload-on-template/79183>\
**Category:** Dashboard\
**Created:** [13 June 2023 20:33 UTC](https://discourse.nodered.org/t/problem-showing-payload-on-template/79183 "2023-06-13T20:33:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mariulin](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mariulin](https://discourse.nodered.org/u/mariulin)\
**Post date:** [13 June 2023 20:33 UTC](https://discourse.nodered.org/t/problem-showing-payload-on-template/79183/1 "2023-06-13T20:33:02Z")

</div>

Hello everybody,  
I've a problem with the attached flow. The problem is that the template shows only the value that I inject, but I need to see both at same time.

Where I'm wrong?  
Thanks to all

[flows.json](https://discourse.nodered.org/uploads/short-url/2SF9L98C7CwzC5T0KTSJ3xkSRy8.json) (5.6 KB)

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [13 June 2023 21:06 UTC](https://discourse.nodered.org/t/problem-showing-payload-on-template/79183/2 "2023-06-13T21:06:25Z")

</div>

Use a join node so that all messages arriving at the ui-template contain both msg.payload.alba and msg.payload.tramonto.

 ![Untitled 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/a/4ad784197fa069a09c6ace2f95e7e6882b397737.jpeg)

---

<div class="post-metadata">

**Author:** ![mariulin](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mariulin](https://discourse.nodered.org/u/mariulin)\
**Post date:** [14 June 2023 07:31 UTC](https://discourse.nodered.org/t/problem-showing-payload-on-template/79183/3 "2023-06-14T07:31:33Z")

</div>

Thanks fo your answer, but I did not understand what I must write in **change node** and in **join node**.

Can you explain me a little more please?

Thank you

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [14 June 2023 08:05 UTC](https://discourse.nodered.org/t/problem-showing-payload-on-template/79183/5 "2023-06-14T08:05:15Z")

</div>

I think this should work.

```auto
[{"id":"b9da0b1fa37085a1","type":"file in","z":"1f30610c.47c63f","name":"Legge file \"Orario Alba\"","filename":"/root/scripts/effemeridi/orario_alba","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":570,"y":380,"wires":[["3e89bc77aa801728"]]},{"id":"e4023aaff1b4b453","type":"file in","z":"1f30610c.47c63f","name":"Legge file \"Orario Tramonto\"","filename":"/root/scripts/effemeridi/orario_tramonto","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":580,"y":420,"wires":[["f7c2f8d3dc771bec"]]},{"id":"3e89bc77aa801728","type":"change","z":"1f30610c.47c63f","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"alba","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":380,"wires":[["d71f38e7100bb9d0"]]},{"id":"f7c2f8d3dc771bec","type":"change","z":"1f30610c.47c63f","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"tramonto","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":420,"wires":[["d71f38e7100bb9d0"]]},{"id":"9f173d3cb075fca9","type":"inject","z":"1f30610c.47c63f","name":"Avvia processo","props":[],"repeat":"60","crontab":"","once":true,"onceDelay":"1","topic":"","payloadType":"str","x":340,"y":420,"wires":[["e4023aaff1b4b453"]]},{"id":"1c1e941d50d04e26","type":"inject","z":"1f30610c.47c63f","name":"Avvia processo","props":[],"repeat":"60","crontab":"","once":true,"onceDelay":"1","topic":"","payloadType":"str","x":340,"y":380,"wires":[["b9da0b1fa37085a1"]]},{"id":"8fa322de3ef93fee","type":"ui_template","z":"1f30610c.47c63f","group":"5abbafc9.891a2","name":"Pagina HTML","order":1,"width":6,"height":"2","format":"<!DOCTYPE html>\n\n<html>\n<head>\n<style>\n\n/* SCRITTA ORARIO ALBA */\n.scritta_orario_alba{\n font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;\n font-weight: bold;\n font-size: 22px;\n color: grey;\n position: absolute;\n bottom: 10px;\n left: 2%;\n}\n\n/* SCRITTA ORARIO TRAMONTO */\n.scritta_orario_tramonto{\n font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;\n font-weight: bold;\n font-size: 22px;\n color: grey;\n position: absolute;\n bottom: 10px;\n right: 2%;\n}\n\n</style>\n</head>\n\n<body> \n\n<div class=\"scritta_orario_alba\">{{msg.payload.alba}}</div>\n\n<div class=\"scritta_orario_tramonto\">{{msg.payload.tramonto}}</div>\n\n\n</body>\n</html>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":1140,"y":400,"wires":[[]]},{"id":"d71f38e7100bb9d0","type":"join","z":"1f30610c.47c63f","name":"","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":970,"y":400,"wires":[["8fa322de3ef93fee","3729f994433f64c9"]]},{"id":"3729f994433f64c9","type":"debug","z":"1f30610c.47c63f","name":"debug 391","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1130,"y":440,"wires":[]},{"id":"5abbafc9.891a2","type":"ui_group","name":"Prove","tab":"e10fbfb4.4b9ec","order":1,"disp":true,"width":"6","collapse":false},{"id":"e10fbfb4.4b9ec","type":"ui_tab","name":"Prove","icon":"dashboard","order":15,"disabled":false,"hidden":false}]

```

However I am unsure about your template node, I don't think you need the doctype, head and body tags in a Node-red dashboard template.

---

<div class="post-metadata">

**Author:** ![mariulin](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mariulin](https://discourse.nodered.org/u/mariulin)\
**Post date:** [14 June 2023 08:19 UTC](https://discourse.nodered.org/t/problem-showing-payload-on-template/79183/6 "2023-06-14T08:19:55Z")

</div>

Sorry, but doesn't work.  
Nothing appaer in Dashboard and the Debug Messages show this

 ![immagine](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/2/a2c2c130c91c09c8f71359535945335403a075b9.png)

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [14 June 2023 08:29 UTC](https://discourse.nodered.org/t/problem-showing-payload-on-template/79183/7 "2023-06-14T08:29:49Z")

</div>

My mistake, not had coffee yet! Setup the join node like this

 ![Untitled 3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/3/93bfda2f96aad35a6469215913f3595c55157eed.jpeg)

---

<div class="post-metadata">

**Author:** ![mariulin](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mariulin](https://discourse.nodered.org/u/mariulin)\
**Post date:** [14 June 2023 08:33 UTC](https://discourse.nodered.org/t/problem-showing-payload-on-template/79183/8 "2023-06-14T08:33:27Z")

</div>

Correct... No coffee!!! One beer 🙂

I finish a work and I try your last solution  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![mariulin](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mariulin](https://discourse.nodered.org/u/mariulin)\
**Post date:** [14 June 2023 08:42 UTC](https://discourse.nodered.org/t/problem-showing-payload-on-template/79183/9 "2023-06-14T08:42:06Z")

</div>

YESS !!!!  
It works

Thank you very much and if you came in North Italy, you have 2 (not only one) paid beers  
Start with this: 🍺

Now I implement your solution in my really DASHBOARD. It is a little bit more complex that the example I've posted, but if it works here, it will works also in my DASHBOARD

Bye bye
