export type ICellValueBase = | null | number | string | boolean | ISegment[] | IMultiSelectedIds | ITimestamp | IAttachmentValue[] | ILinkIds | IUnitIds;
export type ILookUpValue = ICellValueBase[];
export type ICellValue = ICellValueBase | ILookUpValue;
In the chapter on “Snapshots,” we discussed the concept of computed fields in addition to the basic and advanced field types. In this section, we will delve deeper into field classification and categorize them into 9 major types, which are distinguished by the common data structure behind them. They all implement the base class of their respective major types to share common methods.
Text Types
Single-Line Text
Long Text
URL
Phone
Number Types
Number
Currency
Rating
Percent
Autonumber
Date and Time Types
Date
Created Time
Last Edited Time
Member Types
Member
Created By
Last Edited By
Boolean Types
Checkbox
Attachment Types
Attachment
Single-Select Types
Select
Multi-Select Types
Multi-Select
Linking Types
Magic Link
Similar to the concept of database fields, how to parse the cellValue in a cell is defined by the 9 different types mentioned above.
Formatter
Formatter is an important concept for fields containing numeric and date values. Formatter refers to how the value stored in that field is displayed.
For example, if you have a numerical cell field with a value of 3.4 and the formatter is set to ‘1’, then the displayed value would be rounded down (with no decimal places) to become 3. However, the actual value remains unchanged at 3.4. When involved in mathematical calculations like sorting, filtering, formula comparisons, etc., the real value is used rather than the formatted one. To view the actual data stored behind a formatted value, simply double click on top of the numerical cell to activate the edit box.
Let’s take a look at what the first layer of kv in the record data represents without further ado:
id: the value of recordId (note that recordId is unique only within the current table and may be duplicated in other tables when copying tables), which matches the id in rows one by one
data: the cellvalue data of the table, which stores the original data structure of cellvalue. Each field has its unique data structure. The cellvalue of basic fields comes from user input, while the cellvalue of computed fields comes from calculation results. How cellvalue values are displayed often requires a comprehensive judgment in conjunction with the field settings.
revisionHistory: an array of version numbers. When a modified version of the table is related to this record, the version number will be recorded here, which will be discussed in detail in 0x8 version control Version Control.
recordMeta: maintains the current record’s modifier, creator, modification time, creation time, and is accurate to the field level (already removed from the snapshot in TeamX environment)
commentCount: number of comments
https://github.com/ottypes/json0
https://help.apitable.com/docs/guide/manual-lastmodifiedby/
➤ YN0000: └ Completed in 24s 137ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 22s 700ms
➤ YN0000: Done with warnings in 56s 101ms
➤ YN0000: Type Error: Could not parse the Cargo.toml: Error: Command failed: cargo metadata —format-version 1 —manifest-path “/devenv/packages/room-native-api/Cargo.toml”
➤ YN0000: /bin/sh: cargo: command not found
➤ YN0000:
➤ YN0000: /bin/sh: cargo: command not found
➤ YN0000:
➤ YN0000: at BuildCommand.
No errors found. [HPM] Proxy created: /nest -> http://127.0.0.1:3333 [HPM] Proxy created: /api -> http://127.0.0.1:8081 [HPM] Proxy created: /fusion -> http://127.0.0.1 [HPM] Proxy created: /room -> http://127.0.0.1:3005 [HPM] Proxy created: /notification -> http://127.0.0.1:3002
Ready on http://localhost:3000 No errors found.
[Nest] 89208 - 06/03/2023, 11:28:23 AM LOG [InstanceLoader] CommandModule dependencies initialized +1ms [Nest] 89208 - 06/03/2023, 11:28:23 AM LOG [InstanceLoader] GrpcClientModule dependencies initialized +3ms [Nest] 89208 - 06/03/2023, 11:28:23 AM ERROR [ExceptionHandler] init repository
Caused by: 0: Input/output error: Input/output error: Connection refused (os error 61) 1: Input/output error: Connection refused (os error 61) 2: Connection refused (os error 61) Error: init repository
Caused by: 0: Input/output error: Input/output error: Connection refused (os error 61) 1: Input/output error: Connection refused (os error 61) 2: Connection refused (os error 61) at new NativeService (/Users/rang/rang/apitable/packages/room-server/src/shared/services/native/native.service.ts:22:77) at Injector.instantiateClass (/Users/rang/rang/apitable/node_modules/@nestjs/core/injector/injector.js:300:19) at callback (/Users/rang/rang/apitable/node_modules/@nestjs/core/injector/injector.js:48:41) at processTicksAndRejections (node:internal/process/task_queues:95:5) at Injector.resolveConstructorParams (/Users/rang/rang/apitable/node_modules/@nestjs/core/injector/injector.js:124:24) at Injector.loadInstance (/Users/rang/rang/apitable/node_modules/@nestjs/core/injector/injector.js:52:9) at Injector.loadProvider (/Users/rang/rang/apitable/node_modules/@nestjs/core/injector/injector.js:74:9) at async Promise.all (index 6) at InstanceLoader.createInstancesOfProviders (/Users/rang/rang/apitable/node_modules/@nestjs/core/injector/instance-loader.js:44:9) at /Users/rang/rang/apitable/node_modules/@nestjs/core/injector/instance-loader.js:29:13 at async Promise.all (index 2) at InstanceLoader.createInstances (/Users/rang/rang/apitable/node_modules/@nestjs/core/injector/instance-loader.js:28:9) at InstanceLoader.createInstancesOfDependencies (/Users/rang/rang/apitable/node_modules/@nestjs/core/injector/instance-loader.js:18:9) at /Users/rang/rang/apitable/node_modules/@nestjs/core/nest-factory.js:93:17 at Function.asyncRun (/Users/rang/rang/apitable/node_modules/@nestjs/core/errors/exceptions-zone.js:22:13) at NestFactoryStatic.initialize (/Users/rang/rang/apitable/node_modules/@nestjs/core/nest-factory.js:91:13) ^Cmake[2]: _ [_run-local-room-server] Error 1 make[1]: _ [run-local] Interrupt: 2
lng,lat
FieldType.SingleText, FieldType.Text, FieldType.SingleSelect, FieldType.MultiSelect, FieldType.Link, FieldType.LookUp, FieldType.Formula, FieldType.Number, FieldType.Currency, FieldType.Percent, FieldType.AutoNumber, FieldType.DateTime, FieldType.CreatedTime, FieldType.LastModifiedTime, FieldType.Attachment, FieldType.Member, FieldType.CreatedBy, FieldType.LastModifiedBy, FieldType.Checkbox, FieldType.Rating, FieldType.URL, FieldType.Phone, FieldType.Email, FieldType.Cascader,
[FieldType.Number]: {
title: t(Strings.field_title_number),
subTitle: t(Strings.field_desc_number),
type: FieldType.Number,
canBePrimaryField: true,
fieldGroup: FieldGroup.Common,
help: t(Strings.field_help_number),
hasOptSetting: true,
},
[FieldType.SingleSelect]: {
title: t(Strings.field_title_single_select),
subTitle: t(Strings.field_desc_single_select),
type: FieldType.SingleSelect,
canBePrimaryField: false,
fieldGroup: FieldGroup.Common,
help: t(Strings.field_help_single_select),
hasOptSetting: true,
},
// The store cannot be called here! !
/**
* When the column type does not change, the single-selection and multi-selection types need to clean the cell values
*/
function changeFieldSetting(
- Execute general data conversion logic when the type of the column changes */ function switchFieldRecordData( context: ICollaCommandExecuteContext, snapshot: ISnapshot, oldField: IField, newField: IField, ) { const { model: state, ldcMaintainer } = context; const actions: IJOTAction[] = []; // Converted into an associated field to synchroniz