I’m hoping someone has run into this before and can help me out. I’m sure I just have a syntax error somewhere or something equally silly.
I’m using jQuery AJAX (I have to, I will explain why if anyone asks).
I am able to retrieve, post, and patch data for everything but my checkbox field. I have sent the value “true” with and without quotes.
Here is my code:
$.ajax({
url: `${Airtable.API}/To%20Do/${recordId}`,
type: 'PATCH',
headers: {
authorization: `Bearer ${Airtable.API_KEY}`,
contentType: "application/json"
},
data: {
"fields": {
"Done": true // does not work as "true" or true
}
}
})
.fail((error) => {
console.error("There was an error processing your request:", error, error.responseText);
})
.done((response) => {
console.log(response);
});
Here is the error:
responseJSON: {
error: {
{
message: "Field Done can not accept value true"
type: "INVALID_VALUE_FOR_COLUMN"
}
}
For reference, this is a simple TODO table. The shape of the data is just:
Name: String,
Notes: String (Long Text),
Done: Boolean