# Retrieve an ENV variable label in subflow

**URL:** <https://discourse.nodered.org/t/retrieve-an-env-variable-label-in-subflow/52222>\
**Category:** General\
**Created:** [14 October 2021 15:51 UTC](https://discourse.nodered.org/t/retrieve-an-env-variable-label-in-subflow/52222 "2021-10-14T15:51:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fmarzocca](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmarzocca/32/35901_2.png) [@fmarzocca](https://discourse.nodered.org/u/fmarzocca)\
**Post date:** [14 October 2021 15:51 UTC](https://discourse.nodered.org/t/retrieve-an-env-variable-label-in-subflow/52222/1 "2021-10-14T15:51:56Z")

</div>

Hi,

I have set Lables on an env variable in a subflow (as a list), as shown:

![Schermata 2021-10-14 alle 17.47.43](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/4/24d22da45e918ba9d22ed5d5352d7c65d243d366.png)

Now, I need to retrieve the Label in a function (in the same subflow), depending upon the choosen value. The env variable is named ACTION.

Any suggestion?

---

<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:** [14 October 2021 15:59 UTC](https://discourse.nodered.org/t/retrieve-an-env-variable-label-in-subflow/52222/2 "2021-10-14T15:59:45Z")

</div>

Hi @fmarzocca

The env var is set to the value, the label is not exposed in the flow.

If its the label you want rather than the values you have set, then you could change the values to match - `Pause`, `Start`, `Park`.

Or you could include a Function node that has the same table of values and can do the reverse mapping from value to label.

---

<div class="post-metadata">

**Author:** ![fmarzocca](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmarzocca/32/35901_2.png) [@fmarzocca](https://discourse.nodered.org/u/fmarzocca)\
**Post date:** [14 October 2021 16:16 UTC](https://discourse.nodered.org/t/retrieve-an-env-variable-label-in-subflow/52222/3 "2021-10-14T16:16:56Z")

</div>

Ok. Thanks. A function will work!

- Sent from my mobile phone. Sorry for typos -

---

<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:** [13 December 2021 16:17 UTC](https://discourse.nodered.org/t/retrieve-an-env-variable-label-in-subflow/52222/4 "2021-12-13T16:17:42Z")

</div>

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