In short: Pack makers that have built Packs using two-way sync with select lists may need to update their code.
The hint type SelectList
was added to the Packs SDK to allow for synced columns to be edited like select lists. The Pack code defines which values are allowed for the select, using either a static array of options or a function that dynamically fetches them.
Currently these select lists only contained the defined options, but normal Coda select lists also include a “Blank” option, which is useful when you want to remove or unset the value.
Starting on January 22, 2024 we’ll be changing the default behavior of two-way sync select lists to also include the blank option. If you wish to remove the blank option for a given column, update your Pack to set the property field requireForUpdates
to true
.
const ExpenseSchema = coda.makeObjectSchema({
properties: {
// ...
category: {
type: coda.ValueType.String,
codaType: coda.ValueHintType.SelectList,
options: async function (context) {
return await getCategories(context);
},
// A category is required, so don't offer the "Blank" option.
requireForUpdates: true,
}
}
});
Be aware that even with the blank option removed there are other ways for a user to clear the value of the cell, for example using the delete key or the “cut” keyboard shortcut. So you may still want to include some validation in your Pack code to make sure a value is set.
Finally, this change also applies to Relation columns (created using the Reference
hint) that define an options
function. You can likewise use requireForUpdates
in those properties to disable the blank value.