テーブル、フィールド、レコード

Baseには、順序付けられたテーブルが含まれます。各テーブルには、フィールド定義、レコード値、オプションのセルデータ行列、リソース、ビュー、およびレンダリングや検索のロジックで使用するインデックスが含まれます。

新しいテーブルのレコード数は 0 です。Facade API またはインポートするスナップショットで明示的に追加してください。

テーブルのスナップショット

プロパティ型説明
idstringテーブルID。
namestringテーブル名。
fieldsRecord\<string, IFieldSnapshot\>フィールドIDをキーとするフィールド定義。
fieldOrderstring[]フィールドIDを順番に並べたリスト。
recordsRecord\<string, IRecordSnapshot\>レコードIDをキーとするレコードデータ。
recordOrder?string[]レコードIDを順番に並べたリスト。
primaryFieldIdstringプライマリフィールドのID。
viewsRecord\<string, IViewSnapshot\>ビューIDをキーとするビュー。
viewOrderstring[]ビューIDを順番に並べたリスト。
resources?IBaseResources選択肢、メンバー、添付ファイルで共有するリソース。

フィールドのスナップショット

プロパティ型説明
idstringフィールドID。
namestringフィールド名。
description?stringフィールドの説明。
typeBaseFieldTypeフィールドの型。
configRecord\<string, unknown\>フィールド型固有の設定。
defaultValue?BaseCellValue新しいレコードのデフォルト値。
system?booleanシステムが管理するフィールドかどうか。
readonly?boolean値が読み取り専用かどうか。

フィールド型

一般的なフィールド型には、text、number、currency、progress、rating、checkbox、singleSelect、multiSelect、person、group、date、attachment、formula、createdAt、updatedAt、createdBy、updatedBy があります。

アプリケーションコードを作成するときは、Facadeの列挙型を使用します。

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

レコードのスナップショット

プロパティ型説明
idstringレコードID。
valuesRecord\<string, BaseCellValue\>フィールドIDをキーとする値。
orderKeystring順序を安定して保持するためのキー。
createdAtnumber作成時のタイムスタンプ。
updatedAtnumber更新時のタイムスタンプ。
createdBy?string作成者のID。
updatedBy?string最終更新者のID。

Facadeの例

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',})

このガイドはいかがですか?

© 2026 DreamNum Co., Ltd.