# Node-red subflow environment variables

**URL:** <https://discourse.nodered.org/t/node-red-subflow-environment-variables/58783>\
**Category:** General\
**Created:** [22 February 2022 00:07 UTC](https://discourse.nodered.org/t/node-red-subflow-environment-variables/58783 "2022-02-22T00:07:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_1](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@Daniel\_1](https://discourse.nodered.org/u/Daniel_1)\
**Post date:** [22 February 2022 00:07 UTC](https://discourse.nodered.org/t/node-red-subflow-environment-variables/58783/1 "2022-02-22T00:07:27Z")

</div>

Hello i defined a node-red subflow environment variable like this

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/7/474f91a3e14ec93f90cb7e365eedc2f6897bc071.png)

Why I cant use math expresions like 2\*1000

i.e.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/1/3169824479615a8ea94a0185a23b063ddba1b623.png)

is there a workaround?

Since the variable is in mseg i'd prefer for clarity use 15 \* 60 \* 1000 for a 15 minute delay  
Thanks in advance  
Daniel

---

<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:** [22 February 2022 00:11 UTC](https://discourse.nodered.org/t/node-red-subflow-environment-variables/58783/2 "2022-02-22T00:11:35Z")

</div>

> [@Daniel\_1](#):
>
> Why I cant use math expresions like 2\*1000

Because the input only supports numbers. It does not support arbitrary maths expressions.

In other places you could change the type to JSONata to use expressions like that, but as that is normally evaluated in the context of a message being handled by a node, it doesn't fit the environment variable module where they are evaluated at the point in time the flows are started.

---

<div class="post-metadata">

**Author:** ![Daniel\_1](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@Daniel\_1](https://discourse.nodered.org/u/Daniel_1)\
**Post date:** [22 February 2022 00:27 UTC](https://discourse.nodered.org/t/node-red-subflow-environment-variables/58783/3 "2022-02-22T00:27:45Z")

</div>

Hello Nick, Thanks for your answer.  
I'm using Node-red since 2016. It is wonderful !!!  
I read you are Node-red creator. Congrats !!!! Thank you for doing such an awesome software.  
Best Regards  
Sincerely yours  
Daniel

---

<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 April 2022 00:28 UTC](https://discourse.nodered.org/t/node-red-subflow-environment-variables/58783/4 "2022-04-23T00:28:15Z")

</div>

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