# Refresh the template

**URL:** <https://discourse.nodered.org/t/refresh-the-template/41461>\
**Category:** Dashboard\
**Created:** [23 February 2021 04:36 UTC](https://discourse.nodered.org/t/refresh-the-template/41461 "2021-02-23T04:36:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bird](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bird/32/34966_2.png) [@bird](https://discourse.nodered.org/u/bird)\
**Post date:** [23 February 2021 04:36 UTC](https://discourse.nodered.org/t/refresh-the-template/41461/1 "2021-02-23T04:36:00Z")

</div>

Hi

ESP32 sends the IP address using MQTT.  
Node-Red receives IP.

Then, in Template, it shows the image using the following code.  
(However, Node-Red should be refesh.)

![]()

When I received IP address as MQTT, how can I set the IP to Template and refresh?

```auto
[{"id":"3b02cbd8.63b414","type":"tab","label":"test","disabled":false,"info":""},{"id":"27e75e0b.f651e2","type":"mqtt in","z":"3b02cbd8.63b414","name":"","topic":"iot_device","qos":"2","datatype":"auto","broker":"bbceadd3.f1d4e","x":130,"y":300,"wires":[["87673929.e6d958"]]},{"id":"1ee72f3b.254e31","type":"ui_template","z":"3b02cbd8.63b414","group":"4765c354.bc2a3c","name":"","order":2,"width":12,"height":9,"format":"<img src={{msg.payload}} width=\"600\" height=\"400\">","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":660,"y":300,"wires":[[]]},{"id":"87673929.e6d958","type":"json","z":"3b02cbd8.63b414","name":"","property":"payload","action":"","pretty":false,"x":330,"y":300,"wires":[["e98b4b11.9d24f8"]]},{"id":"e98b4b11.9d24f8","type":"function","z":"3b02cbd8.63b414","name":"","func":"msg.payload = \"http://\" + msg.payload.ip;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":510,"y":300,"wires":[["1ee72f3b.254e31","2f6a51d3.66546e","95513536.eea448"]]},{"id":"2f6a51d3.66546e","type":"debug","z":"3b02cbd8.63b414","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":680,"y":220,"wires":[]},{"id":"95513536.eea448","type":"ui_text","z":"3b02cbd8.63b414","group":"4765c354.bc2a3c","order":1,"width":12,"height":1,"name":"","label":"Ip Address :","format":"{{msg.payload}}","layout":"row-spread","x":680,"y":160,"wires":[]},{"id":"bbceadd3.f1d4e","type":"mqtt-broker","name":"","broker":"test.mosquitto.org","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"4765c354.bc2a3c","type":"ui_group","name":"camera","tab":"4a936a6e.c33414","order":1,"disp":true,"width":12,"collapse":false},{"id":"4a936a6e.c33414","type":"ui_tab","name":"Camera","icon":"dashboard","order":6,"disabled":false,"hidden":false}]

```

thanks

---

<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 February 2021 08:31 UTC](https://discourse.nodered.org/t/refresh-the-template/41461/3 "2021-02-23T08:31:18Z")

</div>

put quotes around the `src` attribute value in your template.

bad...

```auto
<img src={{payload}} width="600" height="400">

```

good...

```auto
<img src="{{payload}}" width="600" height="400">

```

---

<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:** [25 March 2021 08:31 UTC](https://discourse.nodered.org/t/refresh-the-template/41461/4 "2021-03-25T08:31:22Z")

</div>

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