Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Mar 06, 2024 06:51 AM
Afternoon, all,
I have an automation which fills in a select field based on a linked field's id.
If the item doesn't exist in the select field already, it automatically creates a new item in the field.
However, every time the new item is created by the automation it's blue. Every new item is always blue.
Is this a bug? When we add them manually (which we don't want to do - hence why we automated it) they are colourised.
Here is the field,
Any clues, or help much appreciated. Thank you.
Best, DanC
Mar 06, 2024 07:55 AM
I don't know that there's a way around that I'm afraid; hopefully someone else has an idea
As a workaround, you could use a script to help you update the select field and randomize the colors of all the options if you've got a ton of them?
Mar 06, 2024 08:57 AM
Thanks @TheTimeSavingCo - it appears an automation script can't update a field's config settings, "Error: Cannot update field config from scripting automation".
let table = base.getTable("Table 1");
const selectField = table.getField('The Select');
// attempt to make the item a colour
await selectField.updateOptionsAsync({
choices: [
{
"id": "sel123456789ABCD",
"name": "Item 1",
"color": "purpleBright"
}
],
});
I believe the only ways would be an API call or a manual script on the base.
Mar 10, 2024 12:21 PM
Thanks @TheTimeSavingCo - afraid a script is a manual trigger, so that won't work for us.
Also it seems that using the script block with the internal API won't affect a colour change, and the errors says you can't change the config unless it's done with the external API.