# MQTT set via flow

**URL:** <https://discourse.nodered.org/t/mqtt-set-via-flow/25836>\
**Category:** General\
**Created:** [30 April 2020 21:02 UTC](https://discourse.nodered.org/t/mqtt-set-via-flow/25836 "2020-04-30T21:02:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScheepersJohan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scheepersjohan/32/39556_2.png) [@ScheepersJohan](https://discourse.nodered.org/u/ScheepersJohan)\
**Post date:** [30 April 2020 21:02 UTC](https://discourse.nodered.org/t/mqtt-set-via-flow/25836/1 "2020-04-30T21:02:13Z")

</div>

Are there a way of setting the MQTT via a flow?

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

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [30 April 2020 21:14 UTC](https://discourse.nodered.org/t/mqtt-set-via-flow/25836/2 "2020-04-30T21:14:23Z")

</div>

per the `Info` tab

### [Inputs](http://localhost:1880/#)

`payload`  
the payload to publish. If this property is not set, no message will be sent. To send a blank message, set this property to an empty String.

`topic`  
the MQTT topic to publish to.

`qos`  
0, fire and forget - 1, at least once - 2, once and once only. Default 0.

`retain`  
set to true to retain the message on the broker. Default false.

Those are the things you can change dynamically

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 April 2020 21:29 UTC](https://discourse.nodered.org/t/mqtt-set-via-flow/25836/3 "2020-04-30T21:29:44Z")

</div>

If you mean setting the broker address then no, I believe not.

---

<div class="post-metadata">

**Author:** ![nlecaude](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nlecaude/32/25_2.png) [@nlecaude](https://discourse.nodered.org/u/nlecaude)\
**Post date:** [30 April 2020 21:56 UTC](https://discourse.nodered.org/t/mqtt-set-via-flow/25836/4 "2020-04-30T21:56:55Z")

</div>

You can use an environment variable in that field though so if you wrap the mqtt node in a subflow you could concatenate env vars to create your topic. That’s still not dynamic though.

---

<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:** [29 June 2020 21:57 UTC](https://discourse.nodered.org/t/mqtt-set-via-flow/25836/5 "2020-06-29T21:57:02Z")

</div>

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