# Receive msg from mqtt to html

**URL:** <https://discourse.nodered.org/t/receive-msg-from-mqtt-to-html/30797>\
**Category:** General\
**Created:** [27 July 2020 21:23 UTC](https://discourse.nodered.org/t/receive-msg-from-mqtt-to-html/30797 "2020-07-27T21:23:41Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [28 July 2020 09:22 UTC](https://discourse.nodered.org/t/receive-msg-from-mqtt-to-html/30797/5 "2020-07-28T09:22:03Z")

</div>

I’m afraid the flow you’ve imagined won’t work in practice. This debug message is coming from the http-in node feeding into your function, as can be seen by the `req` and `res` properties on the object. The `msg.topic` you’re looking for would come from the mqtt-in node wired to the same function node. While I think I understand what your goal is, can you try to explain what your flow is supposed to do, in general terms rather than flow specific.

As for your function node shown here, rather than `msg.topic` holding the string `"undefined"`, it _is_ undefined. I explained the difference [in another topic](https://discourse.nodered.org/t/how-to-delete-a-flow-variable-from-a-function-node/19731/10). In there, your string`"undefined"` would be _non-zero value_ while the undefined seen here is the last one.

---

_[View the full topic](https://discourse.nodered.org/t/receive-msg-from-mqtt-to-html/30797)._
