# How to edit the function with the output of MQTT OUT

**URL:** <https://discourse.nodered.org/t/how-to-edit-the-function-with-the-output-of-mqtt-out/18256>\
**Category:** General\
**Created:** [22 November 2019 00:14 UTC](https://discourse.nodered.org/t/how-to-edit-the-function-with-the-output-of-mqtt-out/18256 "2019-11-22T00:14:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![molly](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@molly](https://discourse.nodered.org/u/molly)\
**Post date:** [22 November 2019 00:14 UTC](https://discourse.nodered.org/t/how-to-edit-the-function-with-the-output-of-mqtt-out/18256/1 "2019-11-22T00:14:41Z")

</div>

As the figure 1 below, I am going to use the MQTT OUT node that sends the downlink data to TTN. But in the debug window, I have two signal humidity and light in msg.payload.payload-fields, but I just want to send one signal in downlink to TTN, so I use a function node, which included the payload of humidity seen in figure 2.  
**However in TTN console, the downlink payload format is wrong, what I want is a float number like payload\_fields.humidity, so I guess the problem is from the function I edits, the first line maybe wrong, how can I write it in the correct Javascript code?**  
`Thanks so much!!!`

 ![%E9%97%AE1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/1385a75292722f771e692440fcd0c249e6eb371f.jpeg) ![%E9%97%AE2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4c861bc91431fe49808f8ce812ec7b80c233356f.jpeg) ![%E9%97%AE3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/54f64e9d6862429841d12d03fbb5062800972b8f.jpeg)
