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

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