# Mqtt question: topic in inject node vs properties (topic) in mqtt node

**URL:** <https://discourse.nodered.org/t/mqtt-question-topic-in-inject-node-vs-properties-topic-in-mqtt-node/78339>\
**Category:** General\
**Created:** [10 May 2023 23:49 UTC](https://discourse.nodered.org/t/mqtt-question-topic-in-inject-node-vs-properties-topic-in-mqtt-node/78339 "2023-05-10T23:49:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kenkoknz](https://avatars.discourse-cdn.com/v4/letter/k/58956e/32.png) [@kenkoknz](https://discourse.nodered.org/u/kenkoknz)\
**Post date:** [10 May 2023 23:49 UTC](https://discourse.nodered.org/t/mqtt-question-topic-in-inject-node-vs-properties-topic-in-mqtt-node/78339/1 "2023-05-10T23:49:47Z")

</div>

Hi,  
I am playing around to connect to thingspeak via mqtt using the mqtt node.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/b/2ba66d6305159b8024772b3e1841fac749042a4c.png)

Initially I send a payload with the appropriate topic in the inject node:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b221c62b8f70a69f7e1462e78c32ad4f6541ddd3.png)  
That did not work...

However, when I added the topic in the mqtt node's properties and just send the payload without the topic, then it works :  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/784c582db3d3f37b7cda5881f2d8a0188bb127ff.png)

I would have thought that the topic would be passed on from the inject node to the mqtt node correctly in the first instance. On inspecting the debug node, the topic is passed on with "". Can some enlighten me on the difference and why?  
Thanks,  
Ken

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [11 May 2023 00:12 UTC](https://discourse.nodered.org/t/mqtt-question-topic-in-inject-node-vs-properties-topic-in-mqtt-node/78339/2 "2023-05-11T00:12:05Z")

</div>

> [@kenkoknz](#):
>
> On inspecting the debug node, the topic is passed on with ""

Do you mean that debug shows msg.topic surrounded by quotes?  
That's just the debug output - so that you can distinguish between "100" and 100

> [@kenkoknz](#):
>
> I would have thought that the topic would be passed on from the inject node to the mqtt node

It works for me. Do you see an error or just nothing?

 ![Untitled 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/1/b1757fdb46f79300ded2d4547cc57660396a7f17.jpeg)

---

<div class="post-metadata">

**Author:** ![kenkoknz](https://avatars.discourse-cdn.com/v4/letter/k/58956e/32.png) [@kenkoknz](https://discourse.nodered.org/u/kenkoknz)\
**Post date:** [11 May 2023 00:49 UTC](https://discourse.nodered.org/t/mqtt-question-topic-in-inject-node-vs-properties-topic-in-mqtt-node/78339/3 "2023-05-11T00:49:55Z")

</div>

oops, my bad, all good now, thanks

---

<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:** [25 May 2023 00:50 UTC](https://discourse.nodered.org/t/mqtt-question-topic-in-inject-node-vs-properties-topic-in-mqtt-node/78339/4 "2023-05-25T00:50:17Z")

</div>

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