# Access subflow name like an environment variable?

**URL:** <https://discourse.nodered.org/t/access-subflow-name-like-an-environment-variable/17061>\
**Category:** General\
**Created:** [23 October 2019 21:14 UTC](https://discourse.nodered.org/t/access-subflow-name-like-an-environment-variable/17061 "2019-10-23T21:14:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keeper](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@Keeper](https://discourse.nodered.org/u/Keeper)\
**Post date:** [23 October 2019 21:14 UTC](https://discourse.nodered.org/t/access-subflow-name-like-an-environment-variable/17061/1 "2019-10-23T21:14:23Z")

</div>

Hello,

maybe I'm missing something here... I've created a subflow with environment variables, which I can set when placing the subflow in the mainflow:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/bdddb109fdbf715e3c42ee24b7f6b832d0246793.png)  
In this case I can use ${Test} inside the subflow with no problem. But how do I access the Name-Property (should expand to "MyName" in the example above)?! I can't get this to work, is it possible or do I need an additional enviornment name to accomplish what I want?

Thanks in advance!

---

<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:** [23 October 2019 21:58 UTC](https://discourse.nodered.org/t/access-subflow-name-like-an-environment-variable/17061/2 "2019-10-23T21:58:16Z")

</div>

You cannot access the name property. You can only access the environment variables you've defined on the subflow.

But you do raise an interesting point that we should consider.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [24 October 2019 09:44 UTC](https://discourse.nodered.org/t/access-subflow-name-like-an-environment-variable/17061/3 "2019-10-24T09:44:19Z")

</div>

Could you set 'Test' up as an object and pass in the name too - something like `{"MyName";"MyVariable"}` - I have no idea if this will work or if it is feasible, just a thought....

---

<div class="post-metadata">

**Author:** ![Keeper](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@Keeper](https://discourse.nodered.org/u/Keeper)\
**Post date:** [24 October 2019 15:08 UTC](https://discourse.nodered.org/t/access-subflow-name-like-an-environment-variable/17061/4 "2019-10-24T15:08:40Z")

</div>

@knolleary Thank you! Atleast I know now, that I'm not doing something wrong here 🙂 Maybe this can be added in a future release.

@zenofmud Yes, I added an additional property (something like NODE\_NAME) and currently type in the node name twice (as "Name" and as "NODE\_NAME"), works fine, but would be easier to have access to the name property 😉 Thanks for your suggestion.
