# Using subflow environment variable to set mqtt topic

**URL:** <https://discourse.nodered.org/t/using-subflow-environment-variable-to-set-mqtt-topic/15331>\
**Category:** General\
**Created:** [9 September 2019 20:53 UTC](https://discourse.nodered.org/t/using-subflow-environment-variable-to-set-mqtt-topic/15331 "2019-09-09T20:53:40Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![tinamore](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tinamore/32/15693_2.png) [@tinamore](https://discourse.nodered.org/u/tinamore)\
**Post date:** [13 September 2019 16:08 UTC](https://discourse.nodered.org/t/using-subflow-environment-variable-to-set-mqtt-topic/15331/7 "2019-09-13T16:08:31Z")

</div>

OK, I understand. Thank you very much

```auto
This only works if it replaces the entire property - it cannot be used to substitute just part of the value. For example, it is not possible to use CLIENT-${HOST}.

```

But it seems this is a limitation. In the subflow there are many mqtt subscribe nodes. For example I use Tasmota for esp8266:

```auto
stat / ROOM1 / power2
tele / ROOM1 / LWT
stat / ROOM1 / RESULT
tele / ROOM1 / STATE

```

Can you give me any solution to replace all ROOM1 in all topic mqtt subscribe node

---

_[View the full topic](https://discourse.nodered.org/t/using-subflow-environment-variable-to-set-mqtt-topic/15331)._
