Skip to content

Interface: PropertyWithOptions<T>

core.PropertyWithOptions

A property with a list of valid options for its value.

Type parameters

Name Type
T extends PackFormulaResult

Hierarchy

  • PropertyWithOptions

ObjectSchemaDefinition

Properties

options

Optional options: PropertySchemaOptions<T>

A list of values or a formula that returns a list of values to suggest when someone edits this property.

Example

properties: {
  color: {
     type: coda.ValueType.String,
     codaType: coda.ValueHintType.SelectList,
     mutable: true,
     options: ['red', 'green', 'blue'],
  },
  user: {
     type: coda.ValueType.String,
     codaType: coda.ValueHintType.SelectList,
     mutable: true,
     options: async function (context) {
       let url = coda.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})
     },
  },
}

Defined in

schema.ts:264


requireForUpdates

Optional requireForUpdates: boolean

Blocks updates from being sent with a blank value.

Defined in

schema.ts:271