# Subflow flow.$parent with env. variable as path possible?

**URL:** <https://discourse.nodered.org/t/subflow-flow-parent-with-env-variable-as-path-possible/51000>\
**Category:** General\
**Created:** [14 September 2021 08:50 UTC](https://discourse.nodered.org/t/subflow-flow-parent-with-env-variable-as-path-possible/51000 "2021-09-14T08:50:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![novski](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/novski/32/23243_2.png) [@novski](https://discourse.nodered.org/u/novski)\
**Post date:** [14 September 2021 08:50 UTC](https://discourse.nodered.org/t/subflow-flow-parent-with-env-variable-as-path-possible/51000/1 "2021-09-14T08:50:42Z")

</div>

Im wondering if it is somehow possible to save a variable from within a subflow and change node to a dynamic path like:  
`flow.$parent.$env('Device Name').temperature` or simmilar.  
to get a flow variable stored in the path of `mydevicename.temperature`

I found out how to do it in a function node (see below if you are searching for that) but was wondering if escapeing $ inside a change node is possible...

Function node solution:  
`flow.set("$parent."+env.get('Device Name')+".temperature", msg.payload);`

---

<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 November 2021 08:50 UTC](https://discourse.nodered.org/t/subflow-flow-parent-with-env-variable-as-path-possible/51000/2 "2021-11-13T08:50:55Z")

</div>

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