Unfortunately there’s no built-in way to dynamically change this setting of an mqtt-out (or mqtt-in) node by default. A big reason for this is because you’re not changing the setting for just this node, you’re changing the setting for the configuration node that all MQTT nodes point at.
Just in case you’re not familiar with configuration nodes, you can find them in the right-hand pane:
This shows list of all your configurations, and a number of how many nodes reference that particular config. You won’t see these nodes in the editor flow itself, they’re just a shared setting for other nodes. The Node-RED documentation site explains it like this: "“the node acts as a simple container for the configuration - it has no actual runtime behavior.” – Configuration nodes : Node-RED
There may be a way to dynamically change settings on a configuration, but it’s not something I’ve looked into before, and I imagine it would require redeploying / restarting the Node-RED runtime somehow…
You may want to search around over at https://discourse.nodered.org/, and maybe repost your question there – the folks there may have a solution for you.
Can I ask what broker you’re using and what the application is for this?
Update to this question.
In Node-RED 2.1 and up, you can have dynamic connections.
There is a really solid write up about how to use those new settings here: