# Posting non-string data to Parse.com using Webhook

**URL:** <https://community.particle.io/t/posting-non-string-data-to-parse-com-using-webhook/16740>\
**Category:** Troubleshooting\
**Created:** [October 21, 2015, 7:57am UTC](https://community.particle.io/t/posting-non-string-data-to-parse-com-using-webhook/16740 "2015-10-21T07:57:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pteja](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/pteja/32/5151_2.png) [@pteja](https://community.particle.io/u/pteja)\
**Post date:** [October 21, 2015, 7:57am UTC](https://community.particle.io/t/posting-non-string-data-to-parse-com-using-webhook/16740/1 "2015-10-21T07:57:18Z")

</div>

Continuing the discussion from [Webhooks with decimal data](https://community.particle.io/t/webhooks-with-decimal-data/16574):

> [@Webhooks with decimal data](https://community.particle.io/t/webhooks-with-decimal-data/16574/1):
>
> Hi,
> 
> I created a Webhook to post data to [parse.com](http://parse.com). That works well except for one tiny detail: decimal numbers are converted to Strings. Is there a way to preserve the double or int type?
> 
> My event looks like the this:
> 
> ```
> {"name":"sensor","data":"{\"status\": 0, \"temp\": 10.46, \"pressure\": 1001.26, \"humidity\": 75.91, \"soil1\": 3290, \"soil2\": 3268, \"soil3\": 3294}","ttl":"60","published_at":"2015-10-15T12:35:08.693Z","coreid":"25002c000447343339373536"}
> 
> ```
> 
> All the relevant data types of the JSON object are decimals, like status, temp, etc.  
> The following Webhook is configured to post that data to [parse.com](http://parse.com):
> 
> ```
> {
> "eventName": "sensor",
> "deviceid": "25002c000447343339373536",
> "url": "https://api.parse.com/1/classes/Status",
> "requestType": "POST",
> "headers": {
> "X-Parse-Application-Id": "12345678",
> "X-Parse-REST-API-Key": "12345678",
> "Content-Type": "application/json"
> },
> "json": {
> "status": "{{status}}",
> "temperature": "{{temp}}",
> "pressure": "{{pressure}}",
> "humidity": "{{humidity}}",
> "soil1": "{{soil1}}",
> "soil2": "{{soil2}}",
> "soil3": "{{soil3}}",
> "coreid": "{{SPARK_CORE_ID}}"
> },
> "mydevices": true,
> "noDefaults": true
> }
> 
> ```
> 
> Technically that working well, I can see the data on the [parse.com](http://parse.com) dashboard. My only problem are the quotes, for the JSON data send, like:
> 
> ```
> "status": "{{status}}"
> 
> ```
> 
> This results in status stored as string at [parse.com](http://parse.com) but I would like to store it as decimal.
> 
> ```
> "status": {{status}}
> 
> ```
> 
> This (without the quotes) does not work. Creating the Webhook fails with the following error:
> 
> > tryParse error [SyntaxError: Unexpected token {]  
> > Please check your .json file for syntax error.
> 
> Any idea how this can be solved?
> 
> Thx  
> Markus

---

<div class="post-metadata">

**Author:** ![pteja](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/pteja/32/5151_2.png) [@pteja](https://community.particle.io/u/pteja)\
**Post date:** [October 21, 2015, 7:59am UTC](https://community.particle.io/t/posting-non-string-data-to-parse-com-using-webhook/16740/2 "2015-10-21T07:59:58Z")

</div>

Thanks @mhdevx. That was really helpful. You saved me a day 😃

How did you convert string to decimal / int on [Parse.com](http://Parse.com)? 😕

---

<div class="post-metadata">

**Author:** ![mhdevx](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mhdevx/32/7047_2.png) [@mhdevx](https://community.particle.io/u/mhdevx)\
**Post date:** [October 21, 2015, 9:16am UTC](https://community.particle.io/t/posting-non-string-data-to-parse-com-using-webhook/16740/3 "2015-10-21T09:16:21Z")

</div>

@pteja I solved that on the [parse.com](http://parse.com) side using their cloud code API. Here you have the option to modify data before or after it is saved.

See here: [https://www.parse.com/docs/cloudcode/guide#cloud-code-modifying-objects-on-save](https://www.parse.com/docs/cloudcode/guide#cloud-code-modifying-objects-on-save)

It is not really nice. You can not modify the data type for a variable (at least it didn’t work for me), so I copy them into new fields parsing strings to int or float and remove the original string value.
