Hi all
I once again ran into this: when trying to prefill a form with a value that’s supposed to end up in a select field (eg “working year”), it doesn’t prefill this data in your form if the data is not already an option in the receiving select field.
No idea if this is logical or not, but it would be great if it would prefill and just create a new option in the receiving select field.
Any thoughts on this?
I suspect that Airtable would say this is “by design”.
How are you generating the pre-filled value?
This is long-standing, behaves-as-expected behavior. I also happen to agree with it. When you add choices to a single select field, that changes schema. And schema should not be changed casually by the filling out of a form. I believe that I f you want to be able to have new value via a form, you should use a different field type.
There are workarounds when the new single select value is put in a text field, and then an automation moves the text value to the single-select, thus adding the choice to the single-select. I suppose this workaround could be adapted to a system with a prefilled form, but why? If you already have the value that you want to prefill, just add it to the schema in advance.
2 Likes
And, it’s possible to have script/automation handle adding the value in advance too.
EDIT: Thanks @Kuovonne for the correction below!
Ok, thanks for your insights
Automation scripts cannot add single-select choices. Scripting extension can. In general, automation scripts cannot change schema.
2 Likes
One “sort-of workaround” is that in Airtable’s native automations, you can use the gear icon to add a value into a single-select or a multi-select… BUT it has to be done through a record.
In other words, you’re not editing the schema directly. You’re actually changing the actual field value of an existing record, which then updates the schema.
Although you could update a dummy record and then use a script to delete it afterwards. But now we’re getting really deep into workarounds… LOL.
1 Like
And once again @ScottWorld gives detailed directions on something that I just say is possible. In my defense, I am usually posting from a mobile device.
Well, it kinda is possible to have an automaton handle adding the value in advance too. It just can’t be done in a scripting action. It would have to be done using an automation as Scott described.
In this case when you want the single select to be a year, I would probably pre-create a bunch of years (say a decade or so) and then document the technical debt somewhere. With luck, the system might be re-engineered before the technical debt comes due.
1 Like
Lol, I didn’t think that your response was lacking in any detail! I just wanted to highlight the gear icon, which is so easily missed.