# Interface: ObjectSchemaDefinition\<K, L>

Defined in: [schema.ts:1351](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1351)

A schema definition for an object value (a value with key-value pairs).

## Extends

- `BaseSchema`.[`PropertyWithOptions`](../PropertyWithOptions/)\<{ }>

## Type Parameters

| Type Parameter | | --- | | `K` *extends* `string` | | `L` *extends* `string` |

## Properties

### attribution?

> `optional` **attribution**: [`AttributionNode`](../../type-aliases/AttributionNode/)[]

Defined in: [schema.ts:1412](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1412)

Attribution text, images, and/or links that should be rendered along with this value.

See [makeAttributionNode](../../functions/makeAttributionNode/).

______________________________________________________________________

### codaType?

> `optional` **codaType**: [`Person`](../../enumerations/ValueHintType/#person) | [`Reference`](../../enumerations/ValueHintType/#reference) | [`SelectList`](../../enumerations/ValueHintType/#selectlist)

Defined in: [schema.ts:1382](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1382)

A hint for how Coda should interpret and render this object value.

For example, an object can represent a person (user) in a Coda doc, with properties for the email address of the person and their name. Using `ValueHintType.Person` tells Coda to render such a value as an @-reference to that person, rather than a basic object chip.

______________________________________________________________________

### createdAtProperty?

> `optional` **createdAtProperty**: [`PropertyIdentifier`](../../type-aliases/PropertyIdentifier/)\<`K`>

Defined in: [schema.ts:1467](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1467)

The name of a property within [ObjectSchemaDefinition.properties](#properties) that can be interpreted as the creation datetime of the object.

Must be a [ValueType.String](../../enumerations/ValueType/#string) or [ValueType.Number](../../enumerations/ValueType/#number) property with the [ValueHintType.Date](../../enumerations/ValueHintType/#date) or [ValueHintType.DateTime](../../enumerations/ValueHintType/#datetime) hints

______________________________________________________________________

### createdByProperty?

> `optional` **createdByProperty**: [`PropertyIdentifier`](../../type-aliases/PropertyIdentifier/)\<`K`>

Defined in: [schema.ts:1475](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1475)

The name of a property within [ObjectSchemaDefinition.properties](#properties) that can be interpreted as the creator of the object.

Must be a [ValueType.String](../../enumerations/ValueType/#string) property with the [ValueHintType.Email](../../enumerations/ValueHintType/#email) hint or a [ValueType.Object](../../enumerations/ValueType/#object) with the [ValueHintType.Person](../../enumerations/ValueHintType/#person) hint

______________________________________________________________________

### description?

> `optional` **description**: `string`

Defined in: [schema.ts:285](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L285)

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

`BaseSchema.description`

______________________________________________________________________

### displayProperty?

> `optional` **displayProperty**: `K`

Defined in: [schema.ts:1374](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1374)

The name of a property within [ObjectSchemaDefinition.properties](#properties) that be used to label this object in the UI. Object values can contain many properties and the Coda UI will display them as a "chip" with only the value of the "displayProperty" property used as the chip's display label. The other properties can be seen when hovering over the chip.

______________________________________________________________________

### ~~featured?~~

> `optional` **featured**: `L`[]

Defined in: [schema.ts:1384](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1384)

#### Deprecated

Use [ObjectSchemaDefinition.featuredProperties](#featuredproperties)

______________________________________________________________________

### featuredProperties?

> `optional` **featuredProperties**: `L`[]

Defined in: [schema.ts:1401](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1401)

A list of property names from within [ObjectSchemaDefinition.properties](#properties) for the "featured" properties of this object, used in sync tables. When a sync table is first added to a document, columns are created for each of the featured properties. The user can easily add additional columns for any other properties, as desired. All featured properties need to be top-level. If you can't or don't want to change the received data format, consider changing the received object after fetching and before returning and assigning it to the schema.

This distinction exists for cases where a sync table may include dozens of properties, which would create a very wide table that is difficult to use. Featuring properties allows a sync table to be created with the most useful columns created by default, and the user can add additional columns as they find them useful.

Non-featured properties can always be referenced in formulas regardless of whether column projections have been created for them.

______________________________________________________________________

### ~~id?~~

> `optional` **id**: `K`

Defined in: [schema.ts:1359](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1359)

#### Deprecated

Use [ObjectSchemaDefinition.idProperty](#idproperty)

______________________________________________________________________

### identity?

> `optional` **identity**: [`IdentityDefinition`](../IdentityDefinition/)

Defined in: [schema.ts:1406](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1406)

An identity for this schema, if this schema is important enough to be named and referenced. See [IdentityDefinition](../IdentityDefinition/).

______________________________________________________________________

### idProperty?

> `optional` **idProperty**: `K`

Defined in: [schema.ts:1364](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1364)

The name of a property within [ObjectSchemaDefinition.properties](#properties) that represents a unique id for this object. Sync table schemas must specify an id property, which uniquely identify each synced row.

______________________________________________________________________

### imageProperty?

> `optional` **imageProperty**: [`PropertyIdentifier`](../../type-aliases/PropertyIdentifier/)\<`K`>

Defined in: [schema.ts:1459](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1459)

The name of a property within [ObjectSchemaDefinition.properties](#properties) that can be used as a rich image preview of the object.

Must be a [ValueType.String](../../enumerations/ValueType/#string) property with the [ValueHintType.ImageAttachment](../../enumerations/ValueHintType/#imageattachment) or [ValueHintType.ImageReference](../../enumerations/ValueHintType/#imagereference) hints

______________________________________________________________________

### includeUnknownProperties?

> `optional` **includeUnknownProperties**: `boolean`

Defined in: [schema.ts:1422](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1422)

Specifies that object instances with this schema can contain additional properties not defined in the schema, and that the packs infrastructure should retain these unknown properties rather than stripping them.

Properties not declared in the schema will not work properly in Coda: they cannot be used natively in the formula language and will not have correct types in Coda. But, in certain scenarios they can be useful.

______________________________________________________________________

### index?

> `optional` **index**: [`IndexDefinition`](../../type-aliases/IndexDefinition/)

Defined in: [schema.ts:1546](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1546)

Defines how to index objects for use with full-text indexing.

______________________________________________________________________

### linkProperty?

> `optional` **linkProperty**: [`PropertyIdentifier`](../../type-aliases/PropertyIdentifier/)\<`K`>

Defined in: [schema.ts:1438](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1438)

The name of a property within [ObjectSchemaDefinition.properties](#properties) that will navigate users to more details about this object

Must be a [ValueType.String](../../enumerations/ValueType/#string) property with a [ValueHintType.Url](../../enumerations/ValueHintType/#url) [ObjectSchemaDefinition.codaType](#codatype).

______________________________________________________________________

### modifiedAtProperty?

> `optional` **modifiedAtProperty**: [`PropertyIdentifier`](../../type-aliases/PropertyIdentifier/)\<`K`>

Defined in: [schema.ts:1483](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1483)

The name of a property within [ObjectSchemaDefinition.properties](#properties) that can be interpreted as the last modified datetime of the object.

Must be a [ValueType.String](../../enumerations/ValueType/#string) or [ValueType.Number](../../enumerations/ValueType/#number) property with the [ValueHintType.Date](../../enumerations/ValueHintType/#date) or [ValueHintType.DateTime](../../enumerations/ValueHintType/#datetime) hints

______________________________________________________________________

### modifiedByProperty?

> `optional` **modifiedByProperty**: [`PropertyIdentifier`](../../type-aliases/PropertyIdentifier/)\<`K`>

Defined in: [schema.ts:1491](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1491)

The name of a property within [ObjectSchemaDefinition.properties](#properties) that can be interpreted as the last modifier of the object.

Must be a [ValueType.String](../../enumerations/ValueType/#string) property with the [ValueHintType.Email](../../enumerations/ValueHintType/#email) hint or a [ValueType.Object](../../enumerations/ValueType/#object) with the [ValueHintType.Person](../../enumerations/ValueHintType/#person) hint

______________________________________________________________________

### options?

> `optional` **options**: [`PropertySchemaOptions`](../../type-aliases/PropertySchemaOptions/)\<{ }>

Defined in: [schema.ts:264](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L264)

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

[`PropertyWithOptions`](../PropertyWithOptions/).[`options`](../PropertyWithOptions/#options)

______________________________________________________________________

### ~~primary?~~

> `optional` **primary**: `K`

Defined in: [schema.ts:1366](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1366)

#### Deprecated

Use [ObjectSchemaDefinition.displayProperty](#displayproperty)

______________________________________________________________________

### properties

> **properties**: [`ObjectSchemaProperties`](../../type-aliases/ObjectSchemaProperties/)\<`K` | `L`>

Defined in: [schema.ts:1357](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1357)

Definition of the key-value pairs in this object.

______________________________________________________________________

### requireForUpdates?

> `optional` **requireForUpdates**: `boolean`

Defined in: [schema.ts:271](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L271)

Blocks updates from being sent with a blank value.

#### Inherited from

[`PropertyWithOptions`](../PropertyWithOptions/).[`requireForUpdates`](../PropertyWithOptions/#requireforupdates)

______________________________________________________________________

### snippetProperty?

> `optional` **snippetProperty**: [`PropertyIdentifier`](../../type-aliases/PropertyIdentifier/)\<`K`>

Defined in: [schema.ts:1451](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1451)

The name of a property within [ObjectSchemaDefinition.properties](#properties) that be used as a textual summary of the object.

Must be a [ValueType.String](../../enumerations/ValueType/#string) property or [ValueType.Array](../../enumerations/ValueType/#array) of [ValueType.String](../../enumerations/ValueType/#string)s.

______________________________________________________________________

### subtitleProperties?

> `optional` **subtitleProperties**: [`PropertyIdentifier`](../../type-aliases/PropertyIdentifier/)\<`K`>[]

Defined in: [schema.ts:1444](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1444)

A list of property names from within [ObjectSchemaDefinition.properties](#properties) for the properties of the object to be shown in the subtitle of a rich card preview for formulas that return this object. Defaults to the value of [ObjectSchemaDefinition.featuredProperties](#featuredproperties) if not specified.

______________________________________________________________________

### titleProperty?

> `optional` **titleProperty**: [`PropertyIdentifier`](../../type-aliases/PropertyIdentifier/)\<`K`>

Defined in: [schema.ts:1430](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1430)

The name of a property within [properties](#properties) that will be used as a title of a rich card preview for formulas that return this object. Defaults to the value of [ObjectSchemaDefinition.displayProperty](#displayproperty) if not specified

Must be a [ValueType.String](../../enumerations/ValueType/#string) property

______________________________________________________________________

### type

> **type**: [`Object`](../../enumerations/ValueType/#object)

Defined in: [schema.ts:1355](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1355)

Identifies this schema as an object schema.

______________________________________________________________________

### userEmailProperty?

> `optional` **userEmailProperty**: [`PropertyIdentifier`](../../type-aliases/PropertyIdentifier/)\<`K`>

Defined in: [schema.ts:1499](https://github.com/coda/packs-sdk/blob/b2b4c9dba5ca748bdbb94481cc13b5ca3c328ef6/schema.ts#L1499)

For cases where the object being synced represents a user, the name of the property within [ObjectSchemaDefinition.properties](#properties) that identifies the email address of the user.

Must be a [ValueType.String](../../enumerations/ValueType/#string) property with the [ValueHintType.Email](../../enumerations/ValueHintType/#email) hint or a [ValueType.Object](../../enumerations/ValueType/#object) with the [ValueHintType.Person](../../enumerations/ValueHintType/#person) hint.
