# Template widget shows nothing

**URL:** <https://discourse.nodered.org/t/template-widget-shows-nothing/94758>\
**Category:** General\
**Created:** [20 January 2025 16:12 UTC](https://discourse.nodered.org/t/template-widget-shows-nothing/94758 "2025-01-20T16:12:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Le-Ze](https://avatars.discourse-cdn.com/v4/letter/l/a87d85/32.png) [@Le-Ze](https://discourse.nodered.org/u/Le-Ze)\
**Post date:** [20 January 2025 16:12 UTC](https://discourse.nodered.org/t/template-widget-shows-nothing/94758/1 "2025-01-20T16:12:28Z")

</div>

Hi.  
I have mqtt in node.  
The function will process the output.

```auto
msg.payload = {
    temperature: msg.payload.temperature,
    humidity: msg.payload.humidity
};
return msg;

```

Exit function.  
{"temperature":18.3,"humidity":62.57}

My template.

```auto
<div style="font-family: Arial, sans-serif; background: #2d2d2d; color: white; padding: 15px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); width: 300px; height: auto;">
  <h2 style="text-align: center; margin: 0; font-size: 18px; color: white !important; background: #2d2d2d !important; padding: 10px 0;">
    📊 Data ze Zigbee zařízení
  </h2>
  <div style="margin-top: 15px; padding: 10px;">
    <div style="display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #444;">
      <span>🌡️ <b>Teplota:</b></span>
      <span>{{payload.temperature}} °C</span>
    </div>
    <div style="display: flex; justify-content: space-between; padding: 8px 0;">
      <span>💧 <b>Vlhkost:</b></span>
      <span>{{payload.humidity}} %</span>
    </div>
  </div>
</div>

```

Temperature and humidity are not visible.  
Why? What am I doing wrong?  
Thank you.

 ![template widget](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/f/7f4b405d58d11c6b507f77f5961506892f99caa4.png)

---

<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:** [20 January 2025 17:04 UTC](https://discourse.nodered.org/t/template-widget-shows-nothing/94758/2 "2025-01-20T17:04:00Z")

</div>

Share a minimal flow using inject nodes in place of your MQTT (to provide sample data)

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [20 January 2025 22:49 UTC](https://discourse.nodered.org/t/template-widget-shows-nothing/94758/3 "2025-01-20T22:49:27Z")

</div>

Should be `msg.payload.temperature` and `msg.payload.humidity`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 April 2025 22:49 UTC](https://discourse.nodered.org/t/template-widget-shows-nothing/94758/4 "2025-04-20T22:49:48Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
