1.) Is the Data API really incapable of handling null values?
I am specifically interested in number fields receiving null values via the Data API.
2.) If yes, is the only way to handle nulls to preprocess the data into batches of records that are grouped each batch has its own HTTP request that does not include the fields that would have had null values?
Before anyone suggests it - setting a default value for the number fields I have is not an option for me. For example, one is a Unix Date Integer - setting that puppy to zero won’t cut it.
Hi Jici,
thanks for responding.
Just to make sure…I am talking about the Data API not the API Connector.
here is an example single record payload. I only have to make one change to the key value pair
FROM
“Respuesta_Fecha_Unix”: null
TO
“Respuesta_Fecha_Unix”: 1672531199
and it works.
Full JSON Body.
{
“id_de_Fuente”: 44226,
“Cuestion”: “Who was the leading rusher for the Green Bay Packers in 1969?”,
“Respuesta_Tipo_Texto”: “Donny Anderson”,
“Respues_Fecha_Unix2text”: “Invalid Date”,
“Respuesta_Fecha_Unix”: null,
“Alternativa_01”: “”,
“Alternativa_02”: “”,
“Alternativa_03”: “”,
“Cuestion_tipo_de_datos”: “text”,
“Formato_cuestion_respuesta”: “short-answer”,
“Fuente”: “NFL_team_year_trivia”,
“id_grupo_cuestiones_similares”: “00020c72876fa8a75c3c98eab3e83bbf8199919d76f226fed619ec7324aa8cb6”,
“Categoria”: “Sports & Recreation”,
“SubCategoria”: “American Football”
}
If Alternativa_01 are number field, you will get an error because ""is not valid for number field. You must send null. Bubble will accept "" if this is a string. However, from my point of view, you should send null too to really unset them.
I have concluded that the issue is probably not on the Bubble side. I took what N8N ( the tool I am using to send the data to the Data API) says is be the actual output of the json body and posted it through Postman and it went through fine Nulls and all. N8N must be doing what Bubble does and through in some non json safe characters. Will test today to see what Bubble is actually receiving from the call (if I can remember what tool I use for that) and declare Bubble “Not Guilty” on the post if I conclude that is the case.
**To all reading this post please NOTE. ** This was not a bubble bug!
I have confirmed that the issue I was experiencing was an N8N bug not a Bubble bug. I took the output that was supposedly what N8N was going to send via their HTTP node and sent it using Postman no problem. It was actually N8N rejecting the send before it even went out.