Hi All!
Can anyone provide some scripting advice - I want to create a script that changes a field type from Multiple Select to a Text field when it runs, and another script to do the reverse.
Thanks in advance for any feedback!
Hi All!
Can anyone provide some scripting advice - I want to create a script that changes a field type from Multiple Select to a Text field when it runs, and another script to do the reverse.
Thanks in advance for any feedback!
Scripts cannot change the field type of an existing field. Scripting app can create new fields, but it cannot delete fields.
Why do you want to change the field type?
Many thanks Kuovonne, I did not realize this scripting limitation… I’m creating an airtable form that would include a multiselect dropdown field, however I want it to only show drop-down options that are currently present in that table. Older items which were previously selected as drop-down option (but are no longer selected in the table) would ideally be excluded from showing as drop-down options in the form. Currently, drop-down options will show all current and previously added drop-down options unless you go in and manually delete older ones no longer in use.
Interestingly, one way to clear the “old” unused options would be to convert a field from a drop-down to a text field and then back to a drop-down. It will result in the drop-down options only being the ones currently in the table.
I’m not sure if there is another way to automate the deletion of older drop-down items…
Many thanks Kuovonne, I did not realize this scripting limitation… I’m creating an airtable form that would include a multiselect dropdown field, however I want it to only show drop-down options that are currently present in that table. Older items which were previously selected as drop-down option (but are no longer selected in the table) would ideally be excluded from showing as drop-down options in the form. Currently, drop-down options will show all current and previously added drop-down options unless you go in and manually delete older ones no longer in use.
Interestingly, one way to clear the “old” unused options would be to convert a field from a drop-down to a text field and then back to a drop-down. It will result in the drop-down options only being the ones currently in the table.
I’m not sure if there is another way to automate the deletion of older drop-down items…
There is no way to programmatically delete choices from a multi-select field.
You might want to consider using a linked record field instead.
Good to know, thanks for your help! :thumbs_up:
Not certain if you landed somewhere with this yet.
but here is the solution using linked fields.
Have 2 tables
Table 1
Then create a view that filters out the data based on whatever date field you chose.
(i.e. I want all selections where the record was made within 30 days.)
next
Table 2
Form will replicate the linked field that has limitation to that view
Thanks so much for the helpful feedback @Josh_Stockbridge!
There is another reason it's desirable to change the field type: to reset an auto numbered column.
If you create an auto numbered column, then manually reorder records and want the auto numbering to start from 1 and go to N again, the only way to do that is to temporarily change the type to integer then back to auto number.
But it looks like I can't do that in a script. 😐
I just want my records numbered from 1 to N so I know the priority order I put them in.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.