Apr 25, 2022 07:06 PM
I need to change a single select record based on a separate date record. The single select has multiple options with the same name but different colours, so how I can using automation specify which option to select as well as which colour
As can be seen in the image Confirmed has blue, orange and pink. With automation I need to select a specific Confirmed colour based on the date. I don’t know how to do this.
Apr 25, 2022 09:41 PM
Hi @Naca_Hitchman,
You’d have to get all the options of the single select field, get the id of the specific option you want to use, and update the record like so:
await table.updateRecordAsync(recordId, {
"Single Select Field": {id: [SELECT FIELD OPTION ID]},
})
To get the options, I did:
const table = base.getTable("Table 1")
const selectField = table.getField('Single Select Field');
console.log(selectField.options)
Apr 25, 2022 09:46 PM
Im unable to add scripts to automation, do you need an upgraded account for it?
Apr 25, 2022 09:58 PM
Hi Naca, yeah you need a Pro or Enterprise account to run scripts in an automation.
I think I may have a workaround though. I believe the Scripts block should be accessible on all plans including Free.
What you can do is install the script block, get the id of the single select option you want to use, and just paste that id into your automation like so:
And that should work!