Help

Creating new select options with an automation should colour them... but creates them all blue

Topic Labels: Automations
898 3
cancel
Showing results for 
Search instead for 
Did you mean: 
dancourse
5 - Automation Enthusiast
5 - Automation Enthusiast

Afternoon, all,

I have an automation which fills in a select field based on a linked field's id.

dancourse_1-1709736287395.png

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,

dancourse_3-1709736602069.png

Any clues, or help much appreciated. Thank you.

Best, DanC

 

3 Replies 3

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?

dancourse
5 - Automation Enthusiast
5 - Automation Enthusiast

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.

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.