# Dynamic group creation

**URL:** <https://discourse.nodered.org/t/dynamic-group-creation/92387>\
**Category:** Dashboard\
**Created:** [14 October 2024 20:20 UTC](https://discourse.nodered.org/t/dynamic-group-creation/92387 "2024-10-14T20:20:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![garynl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/garynl/32/95490_2.png) [@garynl](https://discourse.nodered.org/u/garynl)\
**Post date:** [14 October 2024 20:20 UTC](https://discourse.nodered.org/t/dynamic-group-creation/92387/1 "2024-10-14T20:20:42Z")

</div>

I have five xiaomi environment devices each with three sensors (supplying temp, humidity, pressure, and a battery state). I had to implement a group (card?) for each one of them. this makes a 'lot' of work if I need to change anything.

I have just noticed that subflows create a separate instance of each referenced ui node when called, but they are all created on the same tab/group. Is there any way I could dynamically create a group for each sensor? Then I'd need to instruct the subflow to use a newly created group each time it is called. Could the ui\_control node be used for this? I ask because I just used some example code using ui\_control to show and hide groups.  
thxthe  
gary

(sorry if this doesnt make sense, I have a fever and I am really tired)

---

<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:** [14 October 2024 20:24 UTC](https://discourse.nodered.org/t/dynamic-group-creation/92387/2 "2024-10-14T20:24:02Z")

</div>

We don't yet have a solution for this, but if we can work out the how, it would be incredibly valuable.

@Steve-Mcl is also v interested in this

---

<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:** [15 October 2024 14:18 UTC](https://discourse.nodered.org/t/dynamic-group-creation/92387/3 "2024-10-15T14:18:07Z")

</div>

Are you using node-red-dashboard (the original node red dashboard) or @flowfuse/node-red-dashboard, also known as dashboard 2?

---

<div class="post-metadata">

**Author:** ![garynl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/garynl/32/95490_2.png) [@garynl](https://discourse.nodered.org/u/garynl)\
**Post date:** [17 October 2024 20:57 UTC](https://discourse.nodered.org/t/dynamic-group-creation/92387/4 "2024-10-17T20:57:15Z")

</div>

I'm using the original. Sounds like I should investigate Dashboard 2!

---

<div class="post-metadata">

**Author:** ![garynl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/garynl/32/95490_2.png) [@garynl](https://discourse.nodered.org/u/garynl)\
**Post date:** [17 October 2024 21:31 UTC](https://discourse.nodered.org/t/dynamic-group-creation/92387/5 "2024-10-17T21:31:15Z")

</div>

A quick experiment with dashboard-2 shows it creates a unique ui item for each time a subflow is called, but they are created on one group. A more detailed experiment will require some reading!

---

<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:** [18 October 2024 08:22 UTC](https://discourse.nodered.org/t/dynamic-group-creation/92387/6 "2024-10-18T08:22:58Z")

</div>

You can configure your subflow to have an option whereby you define which group it belongs to: [Subflows | Node-RED Dashboard 2.0](https://dashboard.flowfuse.com/user/subflows.html#configuring-subflows-for-dashboard-2-0)

This will mean you can instance your subflow as many times as you like, whilst placing them in different groups too.

---

<div class="post-metadata">

**Author:** ![garynl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/garynl/32/95490_2.png) [@garynl](https://discourse.nodered.org/u/garynl)\
**Post date:** [18 October 2024 17:01 UTC](https://discourse.nodered.org/t/dynamic-group-creation/92387/7 "2024-10-18T17:01:37Z")

</div>

Sounds just right! I'll look into it

---

<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:** [17 November 2024 17:02 UTC](https://discourse.nodered.org/t/dynamic-group-creation/92387/8 "2024-11-17T17:02:22Z")

</div>

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