I've already updated some fields using the Airtable API, but never in a multiple select field. Right now I need to update a multiple select field using Airtable API. For this, I'm implementing the following code in a script action on an automation.
let inputConfig = input.config();
let recordId = inputConfig.recorId;
const update = {
"fields": {
"Testeee": [{name: 'A'}, {name: 'B'}]
}}
let myHeaders = new Headers();
myHeaders.append("Authorization", "I_PUT_MY_VALID_TOKEN_HERE");
myHeaders.append("Content-Type", "application/json");
let response = await fetch(`https://api.airtable.com/v0/{baseid}/{tableid}/${recordId}`, {method: 'PATCH', headers: myHeaders, body: JSON.stringify(update)});
let res = await response.json();
console.log(res);
*consider that the fields {baseid} and {tableid} are correctly filled
I'm receiving an error when I try to run it. The error is:
type: "INVALID_VALUE_FOR_COLUMN"
message: "Cannot parse value for field Testeee"
I've already received this error once when I was trying to update a date field that didn't include time with a date that included time. But this time I couldn't understand why the API is returning this error. I am sure that the field I am trying to update has the option that I am trying to update it with.
If somebody could help me I would appreciate it a lot.
