# Dashboard 2, ui-template in subflow, accessing subflow properties

**URL:** https://discourse.nodered.org/t/dashboard-2-ui-template-in-subflow-accessing-subflow-properties/86714
**Category:** Dashboard
**Tags:** dashboard-2
**Created:** [24 March 2024 12:16 UTC](https://discourse.nodered.org/t/dashboard-2-ui-template-in-subflow-accessing-subflow-properties/86714 "2024-03-24T12:16:49Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [24 March 2024 12:16 UTC](https://discourse.nodered.org/t/dashboard-2-ui-template-in-subflow-accessing-subflow-properties/86714/1 "2024-03-24T12:16:49Z")

</div>

I am experimenting with the new ability to include dashboard 2 widgets in a subflow.  
Am I correct in thinking that, if I have a ui-template in a subflow, that, in order to access the subflow properties inside the template, I have to pick them up and add those properties to a message and send them to the template?

---

<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: [24 March 2024 12:33 UTC](https://discourse.nodered.org/t/dashboard-2-ui-template-in-subflow-accessing-subflow-properties/86714/2 "2024-03-24T12:33:03Z")

</div>

You're absolutely right Colin for the current state of the art.

I do have [UI Template: Custom Properties · Issue #665 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/issues/665) open to improve this experience

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [24 March 2024 13:13 UTC](https://discourse.nodered.org/t/dashboard-2-ui-template-in-subflow-accessing-subflow-properties/86714/3 "2024-03-24T13:13:35Z")

</div>

OK, thanks.

To get round this, in the subflow, I am feeding the input messages through a function that copies the properties into `msg._data` then passes the message to the template. That works ok apart from the problem that if I change the property values and do a partial deploy, then refresh the dashboard browser, the template gets sent the previous message, which still includes the old data. It is not until a new message is sent to the subflow that the new data is picked up. I can't see any solution to this problem at the moment other than to add a repeater node so that messages into the subflow are resent every few seconds.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [24 March 2024 13:25 UTC](https://discourse.nodered.org/t/dashboard-2-ui-template-in-subflow-accessing-subflow-properties/86714/4 "2024-03-24T13:25:28Z")

</div>

I have realised there is a better way. An inject node triggered to fire at startup re-triggers if the subflow parameters are changed, so that can be used to send the template an initial message with the properties,

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [24 March 2024 13:31 UTC](https://discourse.nodered.org/t/dashboard-2-ui-template-in-subflow-accessing-subflow-properties/86714/5 "2024-03-24T13:31:24Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/5/95ae1e663aa6b320b393a6c44c8cbb0855a30616.png)

---

<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: [23 April 2024 13:31 UTC](https://discourse.nodered.org/t/dashboard-2-ui-template-in-subflow-accessing-subflow-properties/86714/6 "2024-04-23T13:31:53Z")

</div>

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