# Data passed by functions to dashboard2

**URL:** <https://discourse.nodered.org/t/data-passed-by-functions-to-dashboard2/89144>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [1 July 2024 13:12 UTC](https://discourse.nodered.org/t/data-passed-by-functions-to-dashboard2/89144 "2024-07-01T13:12:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaetano](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaetano/32/81395_2.png) [@Gaetano](https://discourse.nodered.org/u/Gaetano)\
**Post date:** [1 July 2024 13:12 UTC](https://discourse.nodered.org/t/data-passed-by-functions-to-dashboard2/89144/1 "2024-07-01T13:12:09Z")

</div>

Hi all,  
I'm migrating my flows from dashboard-1 to dashboard-2.  
Previously, I was preparing some data to visualize from a function and use them on a widget.  
For example on a function I prepare msg.label and on the label field of chart node I issue {{msg.label}}.  
Actually, on dashboard-2, the "{{msg.label}}" is the text to visualize on the chart and not the data contained in the variable.  
Is it possible to manage this in a future release of Dashboard-2?

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [1 July 2024 13:26 UTC](https://discourse.nodered.org/t/data-passed-by-functions-to-dashboard2/89144/2 "2024-07-01T13:26:46Z")

</div>

It's one of the most requested features we have: [Programmatic (Mustache) Titles & Labels · Issue #555 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/issues/555)

However, the `{{ }}` method, when directly applied to a node/widget property, is full of security vulnerabilities, so we are in the process of working on an alternative.

The first iteration of this opened today: [UI Text - Support HTML injection by joepavitt · Pull Request #1046 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/pull/1046)

It would use Node-REDs "template" node, and then each node is [being updated](https://github.com/FlowFuse/node-red-dashboard/issues/833) to allow overriding of properties at runtime using `msg.ui_update._<property>`

The use of NR's template has the advantage also of being able to access the `global` and `flow` context stores too, and is less prone to security vulnerabilities

---

<div class="post-metadata">

**Author:** ![Gaetano](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaetano/32/81395_2.png) [@Gaetano](https://discourse.nodered.org/u/Gaetano)\
**Post date:** [1 July 2024 13:34 UTC](https://discourse.nodered.org/t/data-passed-by-functions-to-dashboard2/89144/3 "2024-07-01T13:34:48Z")

</div>

It should be perfect.  
The "problem" is that the property "label" actually doen't permt to be dynamic. So I don't know how I can do what I need.

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [1 July 2024 13:57 UTC](https://discourse.nodered.org/t/data-passed-by-functions-to-dashboard2/89144/4 "2024-07-01T13:57:11Z")

</div>

We are working through all of the widgets as we speak: [Modify/Update UI-widget parameters from external · Issue #833 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/issues/833)

Should only be a couple of weeks

---

<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:** [15 July 2024 13:58 UTC](https://discourse.nodered.org/t/data-passed-by-functions-to-dashboard2/89144/5 "2024-07-15T13:58:09Z")

</div>

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