Sep 20, 2022 12:30 PM
Hi team,
I am using the scripting block to add a new single select option to a bunch of fields at once. Is there any way to specify the color of the item? Currently they all seem to be adding as grey by default.
Thanks!
Solved! Go to Solution.
Sep 20, 2022 02:09 PM
Sep 20, 2022 02:09 PM
Sep 21, 2022 05:40 AM
Okay I had to modify this a bit, and it only takes certain color inputs, but it works! Thank you!
Dropping the code below if anybody else is looking for this in the future:
const table = base.getTable("Your Table Name");
const field = table.getField("Your Field Name");
await field.updateOptionsAsync({
choices: [...field.options.choices, {name: "Bright Blue", color:"blueBright"}],
});
List of colors can be found here but it only accepts the Bright, Dark1, Light1, and Light2 variants since those are the available colors for dropdowns (eg. it will not accept “blue” but it accepts “blueBright”