# Function help to deal with mqtt retained messages/influxdb "unable to parse"

**URL:** <https://discourse.nodered.org/t/function-help-to-deal-with-mqtt-retained-messages-influxdb-unable-to-parse/42218>\
**Category:** General\
**Created:** [7 March 2021 20:25 UTC](https://discourse.nodered.org/t/function-help-to-deal-with-mqtt-retained-messages-influxdb-unable-to-parse/42218 "2021-03-07T20:25:42Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [8 March 2021 13:52 UTC](https://discourse.nodered.org/t/function-help-to-deal-with-mqtt-retained-messages-influxdb-unable-to-parse/42218/4 "2021-03-08T13:52:25Z")

</div>

You can easily test for undefined in a function  
`if (typeof somevar === "undefined") ...`

For future reference, in order to make flows more easily imported, see this post for details of how to share flows here - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

_[View the full topic](https://discourse.nodered.org/t/function-help-to-deal-with-mqtt-retained-messages-influxdb-unable-to-parse/42218)._
