# How to get the property(env value) of subflow with it's node

**URL:** <https://discourse.nodered.org/t/how-to-get-the-property-env-value-of-subflow-with-its-node/97788>\
**Category:** General\
**Tags:** subflow\
**Created:** [25 June 2025 09:34 UTC](https://discourse.nodered.org/t/how-to-get-the-property-env-value-of-subflow-with-its-node/97788 "2025-06-25T09:34:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peeyee](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/peeyee/32/101658_2.png) [@peeyee](https://discourse.nodered.org/u/peeyee)\
**Post date:** [25 June 2025 09:34 UTC](https://discourse.nodered.org/t/how-to-get-the-property-env-value-of-subflow-with-its-node/97788/1 "2025-06-25T09:34:27Z")

</div>

I have designed a custom Node-RED node with a `filename` parameter, which is currently parsed as a plain string.

I would like to allow this parameter to accept dynamic values—for example, by referencing a property defined in a subflow (e.g., `msg.filename` or a subflow environment variable).

What’s the best way to achieve this?

Ideally, the custom node should support **both** :

- static strings (e.g., `/data/file.csv`), and
- dynamic expressions (e.g., `msg.filename` or `flow.filename`) that are evaluated at runtime.

How should I implement this in the custom node to support both modes?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 June 2025 11:28 UTC](https://discourse.nodered.org/t/how-to-get-the-property-env-value-of-subflow-with-its-node/97788/2 "2025-06-25T11:28:03Z")

</div>

> [@peeyee](#):
>
> How should I implement this in the custom node to support both modes?

If you are making a custom node then be better way to do this is using a TypedInput widget- [TypedInput Widget : Node-RED](https://nodered.org/docs/api/ui/typedInput/)

There are some examples at the bottom of that doc.

I would suggest you add `str`, `env` for flexibility (but if you read the [env-var docs](https://nodered.org/docs/user-guide/environment-variables), a `str` field can use env vars too, its just not a flexible as the $env field.

---

<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 September 2025 11:28 UTC](https://discourse.nodered.org/t/how-to-get-the-property-env-value-of-subflow-with-its-node/97788/3 "2025-09-23T11:28:38Z")

</div>

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