Routing data to adafruit IO - Record invalid

I am trying to forward multiple feeds to my adafruit IO account and getting the error:

under events , status it says 422
{“error”:“request failed - Record invalid. Failed to save data to uuuuuu/groups/groupblue. data missing required value”}

this is the body that in the events that gets posted from the arduino program
{
“humidity”: " 23.1",
“temp”: " 71.4"
}

this is the Route I have defined
{
“feeds”:[
{
“key”:“tempf”,
“value”:body.temp
}
{
“key”:“humidity”,
“value”:body.humidity
}
]
}

in adafruit io feeds I have these two feeds defined:
groupblue.humidity
groupblue.tempf

I have also tried adding the group name ‘groupblue’ to the route key, e.g. “key”:“groupblue.tempf”

My URL in routes is: https://io.adafruit.com/api/v2/uuuuuuuuu/groups/groupblue/data where uuuuuu is my username

thanks

Hi @JimK,

The JSONata expression you pasted in is missing a comma between the two key/value pairs. It should look like this:

{
   "feeds":[
      {
         "key": "tempf",
         "value": body.temp
      },
      {
         "key": "humidity",
         "value": body.humidity
      }
   ]
}

Note that you can always test a JSONata transform from your Events page in Notehub. Just select the event and click the “Transform” button so you can see the results before you try and route anything with it.

Thanks,
Rob

thanks Rob, I was online just now trying more things and discovered too, thanks ! btw do you know why whenever I open ‘routes’ it adds a http header with my email and then I cannot save the route until I remove that line ?

thanks for the tip on using the transform button, I was not aware of that.

Are you using a password manager with your browser? It could be auto-populating that field.

I had not thought about that (autofill), I use chrome on a windows laptop. When I mouse over the next empty header field value in the headers and click in it I do get a pop up on my browser to use my email. Thanks