{{SPARK_EVENT_VALUE}} gets HTML encoded

How about allowing the use of Javascript conversion methods like Number() and Boolean() in the template and skipping the quotes in the generated JSON if the result is a number or a boolean.

Example:

{
    "eventName": "hm_",
    "url": "http://myserver.com/device_events",
    "requestType": "POST",
    "json": {
      "name":  "{{PARTICLE_EVENT_NAME}}",
      "value": "{{Number(PARTICLE_EVENT_VALUE)}}",
      "occured_at": "{{PARTICLE_PUBLISHED_AT}}",
      "device_id": "{{PARTICLE_CORE_ID}}"
    },
    "mydevices": true
}
1 Like