# Setting mqtt out node properties from json string

**URL:** <https://discourse.nodered.org/t/setting-mqtt-out-node-properties-from-json-string/66856>\
**Category:** General\
**Created:** [24 August 2022 13:06 UTC](https://discourse.nodered.org/t/setting-mqtt-out-node-properties-from-json-string/66856 "2022-08-24T13:06:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 August 2022 13:09 UTC](https://discourse.nodered.org/t/setting-mqtt-out-node-properties-from-json-string/66856/2 "2022-08-24T13:09:57Z")

</div>

> [@MikeyMikey](#):
>
> Is it possible to set the properties of a mqtt out node e.g. server name, port, protocol, username, password etc from a function in node red

yes.

From the built in help...

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

Demo...

> [@Dynamic MQTT node's "actions-\>connect" guidance needed](https://discourse.nodered.org/t/dynamic-mqtt-nodes-actions-connect-guidance-needed/58878/2):
>
> The dynamic connection does not overwrite fields. It simply connects to the broker specified in the msg you send. You just add a broker (with any settings you like) and set it to NOT auto connect [image] then you send the appropriate msg to set up and connect. Here is a working demo... [mqtt-dyn] [{"id":"a7f43be0a40d080b","type":"mqtt out","z":"8afdb9e0485c9da7","name":"mqtt out","topic":"","qos":"0","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","…

---

_[View the full topic](https://discourse.nodered.org/t/setting-mqtt-out-node-properties-from-json-string/66856)._
