# Use config node parameter on function node in subflow

**URL:** <https://discourse.nodered.org/t/use-config-node-parameter-on-function-node-in-subflow/89333>\
**Category:** General\
**Tags:** function-node, subflow\
**Created:** [7 July 2024 12:43 UTC](https://discourse.nodered.org/t/use-config-node-parameter-on-function-node-in-subflow/89333 "2024-07-07T12:43:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alloc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alloc/32/92632_2.png) [@Alloc](https://discourse.nodered.org/u/Alloc)\
**Post date:** [7 July 2024 12:43 UTC](https://discourse.nodered.org/t/use-config-node-parameter-on-function-node-in-subflow/89333/1 "2024-07-07T12:43:40Z")

</div>

Hi,

I just noticed that Node-RED 4 allows specifying config nodes as parameters to subflows. It works fine in combination with nodes that expect such a config node, like a dashboard node in the subflow getting the group from a subflow parameter.

Now I wanted to access info from such a config node subflow parameter in a function node within the subflow. Specifically I'd want to get the tab name from the ui\_group passed in, but this seems to be a generic issue: When looking at the passed in env-var it looks like it's simply a string. Both when doing env.get("group") in a function node as well as when passing the env var from an inject node to a debug node it simply shows the config node's internal ID only. I can't seem to use things like env.get("group").name to even get the UI group's name.

Is there any way to access the actual node data, not only the config node ID?

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [8 July 2024 08:58 UTC](https://discourse.nodered.org/t/use-config-node-parameter-on-function-node-in-subflow/89333/2 "2024-07-08T08:58:59Z")

</div>

Hi,  
Maybe with `RED.nodes.node("nodeId")`

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [8 July 2024 09:11 UTC](https://discourse.nodered.org/t/use-config-node-parameter-on-function-node-in-subflow/89333/3 "2024-07-08T09:11:26Z")

</div>

Hi,

The Function node does _not_ have access to the runtime apis needed to access other nodes and their configuration.

---

<div class="post-metadata">

**Author:** ![Alloc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alloc/32/92632_2.png) [@Alloc](https://discourse.nodered.org/u/Alloc)\
**Post date:** [8 July 2024 09:23 UTC](https://discourse.nodered.org/t/use-config-node-parameter-on-function-node-in-subflow/89333/4 "2024-07-08T09:23:12Z")

</div>

That's what I gathered from other topics regarding RED.nodes and similar. So there's no way to use the new system to get info from passed in config nodes for regular flow nodes, it only helps with nodes that actually accept those config nodes in their node configuration?  
No way to get e.g. the tab name a passed in ui\_group is on?

---

<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:** [8 July 2024 15:46 UTC](https://discourse.nodered.org/t/use-config-node-parameter-on-function-node-in-subflow/89333/5 "2024-07-08T15:46:15Z")

</div>

Why do you want to know something like that?

---

<div class="post-metadata">

**Author:** ![Alloc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alloc/32/92632_2.png) [@Alloc](https://discourse.nodered.org/u/Alloc)\
**Post date:** [8 July 2024 16:18 UTC](https://discourse.nodered.org/t/use-config-node-parameter-on-function-node-in-subflow/89333/6 "2024-07-08T16:18:18Z")

</div>

I'm using the ui\_control node on some of my subflows to get notified when a user opens a certain tab to trigger replaying some messages to the frontend so the sstate he is shown is correct. In order to do that only when the correct tab is opened I currently need to type the tab name manually in the subflow configuration. I was hoping with the new changes I could just get the name from the same subflow configuration var where I pass in the ui\_group for the UI nodes anyway.

---

<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:** [9 July 2024 14:49 UTC](https://discourse.nodered.org/t/use-config-node-parameter-on-function-node-in-subflow/89333/7 "2024-07-09T14:49:45Z")

</div>

I am sorry, I am not able to understand what you have written, so cannot suggest a better way.

---

<div class="post-metadata">

**Author:** ![Alloc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alloc/32/92632_2.png) [@Alloc](https://discourse.nodered.org/u/Alloc)\
**Post date:** [9 July 2024 15:16 UTC](https://discourse.nodered.org/t/use-config-node-parameter-on-function-node-in-subflow/89333/8 "2024-07-09T15:16:14Z")

</div>

Yeah, I was in a hurry when I wrote that, but wanted to get some info out 🙂

Think this explains it better:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/3/23eff6dcfdd6d447bd760b14c0455302d3d10ad1.png)

So I have subflows that precede a UI template (and with the new changes the UI template would become part of such subflow ideally). In order to have the UI templates show the latest values whenever they get shown (opening a new dashboard session or even switching between tabs in an active session) I need to listen for UI tab changed events and - if appropriate, i.e. the new tab is the one the UI template is on - send the latest values to the UI template.

Currently my subflow has two inputs related to the UI:  
string UITabName - used solely to filter the UI changed event for the correct tab, but has to be entered manually with the exact tab name configured on the dashboard config  
ui\_group UIGroup - used by the UI template note as the parent group

What I want to have is only the ui\_group parameter for the subflow and get the ui\_group's tab name from it, so I don't have to pass the manually entered UITabName string that is prone to cause issues.

I hope that was easier to follow than the mess before 🙂

---

<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:** [7 October 2024 15:17 UTC](https://discourse.nodered.org/t/use-config-node-parameter-on-function-node-in-subflow/89333/9 "2024-10-07T15:17:08Z")

</div>

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