Help

Update a multiple select field using Airtable API

Topic Labels: API
Solved
Jump to Solution
6144 2
cancel
Showing results for 
Search instead for 
Did you mean: 
OPEAConsult
4 - Data Explorer
4 - Data Explorer

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.
1 Solution

Accepted Solutions
Sho
11 - Venus
11 - Venus

I think the multi-select is just an array

"fields": {
"Testeee": ['A','B']
}

See Solution in Thread

2 Replies 2
Sho
11 - Venus
11 - Venus

I think the multi-select is just an array

"fields": {
"Testeee": ['A','B']
}

You are right. It's just an array!!

Thank you very much! I tried to find this information on the Airtable API documentation, but I failed. Do you know where I can find this kind of information whenever I need it?