Tables, Fields & Records

A Base contains ordered tables. Each table contains field definitions, record values, optional cell data matrices, resources, views, and indexes used by rendering and lookup logic.

New tables start with zero records; add records explicitly through the Facade API or imported snapshot data.

Table snapshot

PropertyTypeDescription
idstringTable id.
namestringTable name.
fieldsRecord\<string, IFieldSnapshot\>Field definitions keyed by field id.
fieldOrderstring[]Ordered list of field ids.
recordsRecord\<string, IRecordSnapshot\>Record data keyed by record id.
recordOrder?string[]Ordered list of record ids.
primaryFieldIdstringPrimary field id.
viewsRecord\<string, IViewSnapshot\>Views keyed by view id.
viewOrderstring[]Ordered list of view ids.
resources?IBaseResourcesShared option, member, and attachment resources.

Field snapshot

PropertyTypeDescription
idstringField id.
namestringField name.
description?stringField description.
typeBaseFieldTypeField type.
configRecord\<string, unknown\>Type-specific field config.
defaultValue?BaseCellValueDefault value for new records.
system?booleanWhether the field is system-managed.
readonly?booleanWhether values are read-only.

Field types

Common field types include text, number, currency, progress, rating, checkbox, singleSelect, multiSelect, person, group, date, attachment, formula, createdAt, updatedAt, createdBy, and updatedBy.

Use facade enums when building application code:

TypeScript
const field = table.addField('Due date', univerAPI.Enum.BaseFieldType.Date)

Record snapshot

PropertyTypeDescription
idstringRecord id.
valuesRecord\<string, BaseCellValue\>Values keyed by field id.
orderKeystringStable ordering key.
createdAtnumberCreation timestamp.
updatedAtnumberUpdate timestamp.
createdBy?stringCreator id.
updatedBy?stringLast updater id.

Facade example

TypeScript
const table = base.insertTable('Tasks', { primaryFieldName: 'Title' })const title = table.getPrimaryField()const status = table.addField('Status', univerAPI.Enum.BaseFieldType.SingleSelect)const record = table.addRecord({  [title.getId()]: 'Write guide',  [status.getId()]: 'In progress',})

How is this guide?

© 2026 DreamNum Co., Ltd.