Automation Script: changing multiple-choice data values

506 2
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

Hey Everyone, Can anyone spot where I'm going wrong here?!

I am trying to add multiple values to a multiple-choice field:

const YesVotes = ["Adam", "Bob", "Charlie"];

const YesArray = [];

for (var i = 0; i < YesVotes.length; i++) {
  YesArray.push('{name: ' + YesVotes[i] + '}');


So the console log is giving me what I think I want:

["{name: Adam}", "{name: Bob}", "{name: Charlie}"]

But the function 

output.set('YES Votes', YesArray);

Is not making the change to the YES Votes column of my table.

2 Replies 2
8 - Airtable Astronomer
8 - Airtable Astronomer

Hi @ssdata  - Here's documentation on multiple selects

This works to update options within the field (column)

let table = base.getTable("YOUR TABLE NAME");

const multipleSelectField = table.getField('YES Votes');
await multipleSelectField.updateOptionsAsync({
    choices: [
        {name: 'My new choice'},

the command output.set(varname, value) does not change data in table and setup for field. It just pass value as step output, which you can use in further steps.