# "Function tried to send a message of type number"

**URL:** https://discourse.nodered.org/t/function-tried-to-send-a-message-of-type-number/18021
**Category:** General
**Created:** [15 November 2019 21:50 UTC](https://discourse.nodered.org/t/function-tried-to-send-a-message-of-type-number/18021 "2019-11-15T21:50:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![JaredG](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@JaredG](https://discourse.nodered.org/u/JaredG)
#### Post date: [15 November 2019 21:50 UTC](https://discourse.nodered.org/t/function-tried-to-send-a-message-of-type-number/18021/1 "2019-11-15T21:50:39Z")

</div>

I'm sure this is some type of newb thing. I'm trying to return a value from my array with:

return msg.payload[0].V

(Yes, I want the first value in the array. )  
But I keep getting this error:

"Function tried to send a message of type number"

Does the return need to be converted to a string or some other format?

---

<div class="post-metadata">

### Author: ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)
#### Post date: [15 November 2019 21:57 UTC](https://discourse.nodered.org/t/function-tried-to-send-a-message-of-type-number/18021/2 "2019-11-15T21:57:35Z")

</div>

Object must be returned. msg is object. Object can have properties. Mostly we use `payload` for transport the valuable info. This payload property can be any type.  
`return msg.payload[0].V` sends out number as `V` is probably number in your case.  
You should use that `V` as` msg.payload`  
`msg.payload = (manage the value of V here).`  
then `return msg`

---

<div class="post-metadata">

### Author: ![JaredG](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@JaredG](https://discourse.nodered.org/u/JaredG)
#### Post date: [15 November 2019 23:03 UTC](https://discourse.nodered.org/t/function-tried-to-send-a-message-of-type-number/18021/3 "2019-11-15T23:03:23Z")

</div>

thank you your comment fixed it.

msg.payload = msg.payload[0].V  
return msg
