# Use group env.variable for DB nodes names

**URL:** <https://discourse.nodered.org/t/use-group-env-variable-for-db-nodes-names/82403>\
**Category:** Dashboard\
**Created:** [27 October 2023 16:31 UTC](https://discourse.nodered.org/t/use-group-env-variable-for-db-nodes-names/82403 "2023-10-27T16:31:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeromeVISUALS](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jeromevisuals/32/40103_2.png) [@JeromeVISUALS](https://discourse.nodered.org/u/JeromeVISUALS)\
**Post date:** [27 October 2023 16:31 UTC](https://discourse.nodered.org/t/use-group-env-variable-for-db-nodes-names/82403/1 "2023-10-27T16:31:03Z")

</div>

Hi there,

Still figuring how to handle code blocks repetition the easiest way.

I know that DB nodes in sub-flows is not an option, but maybe there is a kind of work-around with node groups.

Let's say I have a group of DB nodes, with all the logic being done in a subflow , like this :

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/c/4c9af41d7df73fcb5639073fffff3e643b9868d5.png)

In the subflow I can easily adapt the code to different kind of messages by using subflow Env variable.

Now if I duplicate also the DB nodes, either in group or not, then all the nodes have same name as the original, which make it very hard to assign to specific DB pages/groups. So I need to go to each node, and change the node name, and also sometimes gthe DB node topic....

Is there any way to use a group variable, in a DB node name and/or topic field ?

Thanks,

Jerome

---

<div class="post-metadata">

**Author:** ![JeromeVISUALS](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jeromevisuals/32/40103_2.png) [@JeromeVISUALS](https://discourse.nodered.org/u/JeromeVISUALS)\
**Post date:** [31 October 2023 08:38 UTC](https://discourse.nodered.org/t/use-group-env-variable-for-db-nodes-names/82403/2 "2023-10-31T08:38:45Z")

</div>

Hi, no one ?

I guess there is no way to improve then .....

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [31 October 2023 08:54 UTC](https://discourse.nodered.org/t/use-group-env-variable-for-db-nodes-names/82403/3 "2023-10-31T08:54:10Z")

</div>

To my knowledge, the name of _any_ node can't be evaluated using variables, but then I have never needed to do so - so I could be wrong

---

<div class="post-metadata">

**Author:** ![JeromeVISUALS](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jeromevisuals/32/40103_2.png) [@JeromeVISUALS](https://discourse.nodered.org/u/JeromeVISUALS)\
**Post date:** [1 November 2023 16:50 UTC](https://discourse.nodered.org/t/use-group-env-variable-for-db-nodes-names/82403/4 "2023-11-01T16:50:57Z")

</div>

Hi,

thanks for your answer.

Loos like there is definetely nothing which can be improved here....

Cheers

---

<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:** [1 December 2023 16:51 UTC](https://discourse.nodered.org/t/use-group-env-variable-for-db-nodes-names/82403/5 "2023-12-01T16:51:10Z")

</div>

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