Automation Script : Add choices to Multiselect field options

Hello all

Here is my situation:
I have collaborators working on TableFoo on a certain amount of items. When they are done on an item, they change the status and other collaborators take over on it. This other team is working on TableBar
To ease the process, I need to add an Automation action that looks for this status change and creates a record in TableBar whenever it’s triggered.
Problem is, one of the field I need to transfer over is a MultiSelect Field and when I use the createRecordAsync() function as follow, I receive an error

let newRecordID = await TableBar.createRecordAsync({
            "Tags":TableFooRecord.getCellValue("Tags"),
        });

The error is obviously that the “Tags” field of TableBar does not have the same choices as TableFoo.
I read that the Automation is not able to use ‘typecast = true’.

So I thought “fine, I’ll just add step that updates the option of this field in TableBar to have all from TableFoo and I’ll be good”.
Turns out that the methods to do this specific operation multipleSelectField.updateOptionsAsync() return the following error on an Automation script:

Error: Cannot update field config from scripting automation
    at main on line 12

So, is there a way to update multiselect choices list in the Automation? I would like to stick within this is the only way to perform “triggered” script. If I don’t use it, I would have to perform those scripts manually.

Thank you very much

Welcome to the Airtable community!

While apps in scripting can change the base schema (such as adding choices to select fields), automation scripts do not have this ability. This was a design choice on Airtable’s part.

On the other hand, an update action (versus scripting) can add a choice to select fields. This may mean that you need to split your script into two pieces. Part A identifies the necessary select choices. Then an update script creates the option, (possibly in a dummy record), then Part B of the script does everything else necessary.

1 Like

Hi Kuovonne

I guess that will do the trick. I will do that. Thanks :slight_smile:
It’s sad we can’t add basic “If” statement (like if record exists or if-previously-scripted-boolean) in the actions, it would spare me that gymnastic :smile:

Automations in Airtable is still young. I believe that these features will eventually be added. However, for now we have to make do with the features that are currently available.

I am looking forward to it :slight_smile:

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.