# How to update the UI surface on Dashboard when a new message arrived

**URL:** <https://discourse.nodered.org/t/how-to-update-the-ui-surface-on-dashboard-when-a-new-message-arrived/86740>\
**Category:** Developing Nodes\
**Tags:** node-red-dashboard\
**Created:** [25 March 2024 12:23 UTC](https://discourse.nodered.org/t/how-to-update-the-ui-surface-on-dashboard-when-a-new-message-arrived/86740 "2024-03-25T12:23:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![greenDog](https://avatars.discourse-cdn.com/v4/letter/g/e8c25b/32.png) [@greenDog](https://discourse.nodered.org/u/greenDog)\
**Post date:** [25 March 2024 12:23 UTC](https://discourse.nodered.org/t/how-to-update-the-ui-surface-on-dashboard-when-a-new-message-arrived/86740/1 "2024-03-25T12:23:24Z")

</div>

Hello!  
I am in the process of creating my first node to display a speedometer on the dashboard.  
I have the problem that the written HTML code for the dashboard is not updated when a new message arrives.  
My code is structured according to the following scheme:

```auto
module.exports = function(RED) {
  function html(config) {
    var code = String.raw`
    <div>
      <p>text</p>
      <p>${config.var}</p>
    </div>`;
    return code;
  }

  function node(config) {
    var ui = RED.require("node-red-dashboard")(RED);
    RED.nodes.createNode(this, config);
    var done = ui.addWidget({
      format: html(config);
      //definition of more properties
    })
  }
  RED.nodes.registerType('ui_node',FirstNode);
}

```

Is there a function that regenerates the HTML code or is there another way to define the HTML code so that it is regenerated with each new message?

Thank you for your replies.

---

<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:** [24 May 2024 12:23 UTC](https://discourse.nodered.org/t/how-to-update-the-ui-surface-on-dashboard-when-a-new-message-arrived/86740/2 "2024-05-24T12:23:41Z")

</div>

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