Interface: StringWithOptionsSchema¶
A schema representing a value with selectable options.
Extends¶
BaseStringSchema<SelectList>.PropertyWithAutocompleteWithOptionalDisplay<string>
Properties¶
allowNewValues?¶
optionalallowNewValues:boolean
Allow custom, user-entered strings in addition to PropertyWithOptions.options.
codaType¶
codaType:
SelectList
Instructs Superhuman Docs to render this value as a select list.
Overrides¶
BaseStringSchema.codaType
description?¶
optionaldescription:string
A explanation of this object schema property shown to the user in the UI.
If your pack has an object schema with many properties, it may be useful to explain the purpose or contents of any property that is not self-evident.
Inherited from¶
BaseStringSchema.description
options?¶
optionaloptions:PropertySchemaOptions<string| {display:string;value:string; }>
A list of values or a formula that returns a list of values to suggest when someone edits this property.
Example¶
properties: {
color: {
type: sdk.ValueType.String,
codaType: sdk.ValueHintType.SelectList,
mutable: true,
options: ['red', 'green', 'blue'],
},
user: {
type: sdk.ValueType.String,
codaType: sdk.ValueHintType.SelectList,
mutable: true,
options: async function (context) {
let url = sdk.withQueryParams("https://example.com/userSearch", { name: context.search });
let response = await context.fetcher.fetch({ method: "GET", url: url });
let results = response.body.users;
return results.map(user => {display: user.name, value: user.id})
},
},
}
Inherited from¶
PropertyWithAutocompleteWithOptionalDisplay.options
requireForUpdates?¶
optionalrequireForUpdates:boolean
Blocks updates from being sent with a blank value.
Inherited from¶
PropertyWithAutocompleteWithOptionalDisplay.requireForUpdates
type¶
type:
String
Identifies this schema as a string.
Inherited from¶
BaseStringSchema.type