Environment variable in subflow name?

Hi.

Is it possible to use an environment variable in a subflow name, to display the current selection?
Or is there a better way of doing this?

Hi and welcome to the forum

short answer, I believe not.

Your question are very vague and would require more information to give a better response.

What is the selection?

What is "this" ?

You may wish to use the status node output to display the information Subflows : Node-RED. You can then display thr env var in the status.

Otherwise please supply a better explanation of what you are try to do.

I have seen several nodes which if not having a name use default name, and this can change depending on configuration. It is very nice, for example when using inject node, to have the default name show some info about the configuration (for example the value of payload in case of the inject). It also shows a nice repeat symbol if you have enabled that. It's something I'd like to be able to configure with subflows for example.

Exactly what I meant.
Then we could display the name like this: "Subflow name ${ENV_VAR}"

No. Composite values are not possible in regular text boxes

This only works if it replaces the entire property - it cannot be used to substitute just part of the value. For example, it is not possible to use CLIENT-${HOST}.

Ref: Using environment variables : Node-RED

1 Like

Do you know why? I used a similar, older low-code system that was java-based, and it accepted composite values almost everywhere.

I can only speculate but likely technical and legacy reasons that were considered during implementation (I believe env var substitution in any field was introduced later and considerations on impact would have been made).

Also, going forwards, all nodes should really use the typed input which DOES support composite values.

1 Like

I don't think that would work for the Name field, which is a fixed value displayed in the Editor.

correct. i was being rather general/generic here (for brevity)