# Coding help to my project tyia

**URL:** <https://discourse.nodered.org/t/coding-help-to-my-project-tyia/64416>\
**Category:** General\
**Tags:** http-request, function-node\
**Created:** [27 June 2022 12:19 UTC](https://discourse.nodered.org/t/coding-help-to-my-project-tyia/64416 "2022-06-27T12:19:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BeRo](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@BeRo](https://discourse.nodered.org/u/BeRo)\
**Post date:** [27 June 2022 12:19 UTC](https://discourse.nodered.org/t/coding-help-to-my-project-tyia/64416/1 "2022-06-27T12:19:52Z")

</div>

![sensor 1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/5/7588997a512e77b76694d61e1022f797c24a3fc1.png)

Hello i'm new to node red and in need of assistance with a current project of mine. Is the first image using a debug node I was generating strings of data with what the CM and status of my sensor are and I want to save those data to a datasheet so I use a gform and get the url and put that to the httprequest node and it works but only shows the timestamps and not the cm and status I want to send, is there something wrong with the code I put in the function node??

 ![sensor 3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/e/2e145f02285616f19be655f57495a757e53deb9d.png)

code of my function node  
var data = {}  
data.Percentage = String  
data.Status = String

msg.payload = data  
return msg;

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [27 June 2022 13:22 UTC](https://discourse.nodered.org/t/coding-help-to-my-project-tyia/64416/2 "2022-06-27T13:22:15Z")

</div>

If that is your actual function where does the variable `String` come from. I expect you should really have -

```auto
const input = msg.payload.split(', ')
let data = {}

data.Percentage = input[0]
data.Status = input[1]

msg.payload = data

return msg

```

I do not use export to Excel so I do not know how the data should be presented but be aware that in Javascript `data.percentage` is NOT the same as `data.Percentage`
