I'm using a script in an automation to try and add a new option to a single select field. As far as I can tell, everything seems setup correctly. Permissions on the field is also fine too.
Here's the script:
let config = input.config();
let subtaskId = config.subtaskId;
let name = config.name[0];
let color = config.color[0];
let subtasksTable = base.getTable("Subtasks");
const singleSelect = subtasksTable.getField("mySingleSelectField");
await singleSelect.updateOptionsAsync({
choices: [...singleSelect.options.choices, {name: name, color: color}]
});
When I run it, I get this error:
Error: Cannot update field config from scripting automation
at main on line 10
`name` and `color` are input variables that are looking correct. The table and field the script is referencing do exist. From that error message it sounds like this isn't possible from automation, or what exactly am I missing here?