# Subflow setting details from env variables

**URL:** <https://discourse.nodered.org/t/subflow-setting-details-from-env-variables/84962>\
**Category:** General\
**Created:** [27 January 2024 09:03 UTC](https://discourse.nodered.org/t/subflow-setting-details-from-env-variables/84962 "2024-01-27T09:03:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [27 January 2024 09:03 UTC](https://discourse.nodered.org/t/subflow-setting-details-from-env-variables/84962/1 "2024-01-27T09:03:10Z")

</div>

Sorry folks, the hamster in on holidays upstairs.

Here's what I have so far.

Alas things evolved and it became more difficult.

 ![Screenshot from 2024-01-27 19-55-59](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/d/0d6aa1e4aff7e3bdbfb9d48d284226da3366fd96.png)

That worked ok and does work IF the device has only ONE output.

I now have a device that has `3` outputs.

Which throws a spanner in the works with the topic.

So I have the subflow now with this:

![Screenshot from 2024-01-27 19-57-57](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/b/1b4b2ed4c0a5d4640bee3214f6b3c09581a24186.png)

So the `power` is entered (numeric only) and I want to append it to the `topic` - after deleting the `1` which is there now.

So......

Ideally it would be something like:

`J: topic&'/cmnd/power'$power`

But I am not sure that is the correct syntax.  
Yeah, ok, it won't break if I try it.

But I fear my understanding is so far wrong/off, it isn't really going to be working for me.

Thanks in advance.

P.S.  
I just realised I could (maybe) do it this way:

`topic&'/cmnd/power'&power` in the last line of the `change` node.

Just want to double check myself.

I am about to try it, but if you wouldn't mind confirming for me anyway.

Ok, that didn't work.

So this is a _hack_ that works.

 ![Screenshot from 2024-01-27 20-07-58](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/2/02df4a4df7ea63423f48be38c2ef77c387ccd9cf.png)

Yes, it is sloppy, but it works - yes?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [27 January 2024 13:05 UTC](https://discourse.nodered.org/t/subflow-setting-details-from-env-variables/84962/2 "2024-01-27T13:05:28Z")

</div>

> [@Trying\_to\_learn](#):
>
> topic&'/cmnd/power'$power

```auto
topic & '/cmnd/power/' & $env(power)

```

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [27 January 2024 19:40 UTC](https://discourse.nodered.org/t/subflow-setting-details-from-env-variables/84962/3 "2024-01-27T19:40:12Z")

</div>

Silly me.

---

<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:** [10 February 2024 19:40 UTC](https://discourse.nodered.org/t/subflow-setting-details-from-env-variables/84962/4 "2024-02-10T19:40:53Z")

</div>

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