interface_field_types.FieldType
interface/field_types.FieldType
An enum of Vika's field types
import { FieldType } from '@apitable/widget-sdk'
console.log(FieldType.Number)
tips: the value obtained by
getCellValue
are supported for writing to the cell.
Enumeration members
NotSupport
• NotSupport = "NotSupport"
Not support type.
Text
• Text = "Text"
A long text field that can span multiple lines.
Cell read format
string
Cell write format
string
Field property read format
n/a
Field property write format
n/a
Number
• Number = "Number"
A number.
Cell read format
number
Cell write format
number
Field property read format
{
precision: number; // retain decimal places
defaultValue?: string; // default value
symbol?: string; // numerical units
}
Field property write format
{
precision: number; // retain decimal places
defaultValue?: string; // default value
symbol?: string; // numerical units
}
SingleSelect
• SingleSelect = "SingleSelect"
Single select allows you to select a single choice from predefined choices in a dropdown.
Cell read format
{
id: string,
name: string,
color: {
name: string, // The unique name corresponding to the color
value: string // The unique value corresponding to the color
}
}
Cell write format
id: string | { id: string } | { name: string }
Field property read format
{
options: {
id: string;
name: string;
color: {
name: string;
value: string;
};
}[];
defaultValue?: string; // default value(option ID)
}
Field property write format
If the option does not pass an id, it will be assumed that a new option is required
color table Color
If you want to allow options to be deleted, you can pass an object with enableSelectOptionDelete: true as the second argument. By passing this argument, any existing options which are not passed again via options will be deleted, and any cells which referenced a now-deleted options will be cleared.
{
options: {
id?: string;
name: string;
color?: string; // color name
}
defaultValue?: string; // default value(option ID)
}
MultiSelect
• MultiSelect = "MultiSelect"
Multiple select allows you to select one or more predefined choices from a dropdown.
Cell read format
{
id: string,
name: string,
color: {
name: string,
value: string
}
}[]
Cell write format
id: string[] | { id: string }[] | { name: string }[]
Field property read format
{
options: {
id: string;
name: string;
color: {
name: string;
value: string;
};
}[];
defaultValue?: string[];
}
Field property write format
If the option does not pass an id, it will be assumed that a new option is required
color table Color
If you want to allow options to be deleted, you can pass an object with enableSelectOptionDelete: true as the second argument. By passing this argument, any existing options which are not passed again via options will be deleted, and any cells which referenced a now-deleted options will be cleared.
{
options: {
id?: string;
name: string;
color?: string;
}
defaultValue?: string[];
}
DateTime
• DateTime = "DateTime"
A date field configured to also include a time.
Cell read format
string
Cell write format
string | Date
Field property read format
{
dateFormat: DateFormat; // data value format
timeFormat?: TimeFormat; // time value format
includeTime?: boolean, // whether to include time
autoFill?: boolean // whether to automatically fill in the creation time when adding a record
}
Field property write format
{
dateFormat: DateFormat; // data value format
timeFormat?: TimeFormat; // time value format
includeTime?: boolean, // whether to include time
autoFill?: boolean // whether to automatically fill in the creation time when adding a record
}
Attachment
• Attachment = "Attachment"
Attachments allow you to add images, documents, or other files which can then be viewed or downloaded.
Cell read format
Cell read format
First call the official API to upload the attachment, get the corresponding data and then write.
The specified value will overwrite the current cell value.
Field property read format
n/a
Field property write format
n/a
OneWayLink
• OneWayLink = "OneWayLink"
One way link, link to another record.
Cell read format
{
recordId: string,
title: string
}[]
Cell write format
The currently linked record IDs and their primary cell values from the linked datasheet.
recordId[]
Field property read format
{
foreignDatasheetId: string; // The ID of the datasheet this field links to
limitToView?: string; // The ID of the view in the linked datasheet to use when showing
limitSingleRecord?: boolean; // Whether this field prefers to only have a single linked record
}
Field property write format
When updating the associated form ID of a magically associated field, the processing of the associated field corresponding to the associated form.
{
foreignDatasheetId: string; // The ID of the datasheet this field links to
limitToView?: string; // The ID of the view in the linked datasheet to use when showing
limitSingleRecord?: boolean; // Whether this field prefers to only have a single linked record
}
MagicLink
• MagicLink = "MagicLink"
Two way link, link to another record.
Cell read format
{
recordId: string,
title: string
}[]
Cell write format
The currently linked record IDs and their primary cell values from the linked datasheet.
recordId[]
Field property read format
{
foreignDatasheetId: string; // The ID of the datasheet this field links to
brotherFieldId?: string; // The ID of the field in the linked table that links back
limitToView?: string; // The ID of the view in the linked datasheet to use when showing
limitSingleRecord?: boolean; // Whether this field prefers to only have a single linked record
}
Field property write format
When updating the associated form ID of a magically associated field, the processing of the associated field corresponding to the associated form.
{
foreignDatasheetId: string; // The ID of the datasheet this field links to
limitToView?: string; // The ID of the view in the linked datasheet to use when showing
limitSingleRecord?: boolean; // Whether this field prefers to only have a single linked record
}
TwoWayLink
• TwoWayLink = "TwoWayLink"
URL
• URL = "URL"
A valid URL.
Cell read format
string
Cell write format
string
Field property read format
n/a
Field property write format
n/a
Email
• Email = "Email"
A valid email address.
Cell read format
string
Cell write format
string
Field property read format
n/a
Field property write format
n/a
Phone
• Phone = "Phone"
A telephone number.
Cell read format
string
Cell write format
string
Field property read format
n/a
Field property write format
n/a
Checkbox
• Checkbox = "Checkbox"
This field is "true" when checked and "null" when unchecked.
Cell read format
boolean
Cell write format
boolean
Field property read format
{
icon: string; // Emoji slug
}
Field property write format
icon Emoji config Emojis
{
icon: 'white_check_mark' | 'ballot_box_with_check'; // icon name
}
Rating
• Rating = "Rating"
A rating.
Cell read format
number
Cell write format
number
Field property read format
{
max: number; // the maximum value for the rating, from 1 to 10 inclusive
icon: string; // Emoji slug
}
Field property write format
icon Emoji config Emojis
{
max: number; // the maximum value for the rating, from 1 to 10 inclusive
icon: 'star' | 'star2' | 'stars'; // icon name
}
Member
• Member = "Member"
Select allows you to select one or more member from a dropdown.
Cell read format
{
id: string,
type: 'Team' | 'Member',
name: string,
avatar?: string,
}[]
Cell write format
id: string[]
Field property read format
{
isMulti: boolean; // one or more member can be selected
shouldSendMsg: boolean; // whether to send message notifications after selecting members
options: [
id: string,
type: 'Team' | 'Member',
name: string,
avatar?: string,
]; // Selected members
}
Field property write format
{
isMulti?: boolean; // one or more member can be selected, default is true (more than one can be selected)
shouldSendMsg?: boolean; // whether to send message notifications after selecting members
}
MagicLookUp
• MagicLookUp = "MagicLookUp"
Lookup a field on linked records.
Cell read format
(read cell value)[]
the cellValue array of the referenced source field.
Is at most a two-dimensional array, if the cellValue of the referenced source field is an array, it is a two-dimensional array, if not, it is a one-dimensional array.
Cell write format
n/a
Field property read format
{
// the linked record field in this datasheet that this field is looking up
relatedLinkFieldId: string;
// the field in the foreign datasheet that will be looked up on each linked record
targetFieldId: string;
// whether the lookup field is correctly configured
hasError?: boolean;
// The entity field that is eventually referenced to does not contain a field of the lookup type.
// In the presence of an error, the entity field may not exist.
entityField?: {
datasheetId: string;
field: IAPIMetaField;
};
// aggregate functions
rollupFunction?: RollUpFuncType;
// return value types, including String, Boolean, Number, DateTime, Array
valueType?: BasicValueType;
// customizable formatting based on the type of field being referenced, such as date, number, percentage, currency field
format?: {
type: 'DateTime' | 'Number' | 'Percent' | 'Currency',
format: Format
};
}
Field property write format
{
// the linked record field in this datasheet that this field is looking up
relatedLinkFieldId: string;
// the field in the foreign datasheet that will be looked up on each linked record
targetFieldId: string;
// aggregate functions
rollupFunction?: RollUpFuncType;
// customizable formatting based on the type of field being referenced, such as date, number, percentage, currency field
format?: {
type: 'DateTime' | 'Number' | 'Percent' | 'Currency',
format: Format
};
}
Formula
• Formula = "Formula"
Compute a value in each record based on other fields in the same record.
Cell read format
null | string | number | boolean | string[] | number[] | boolean
Cell write format
n/a
Field property read format
{
// return value types, including String, Boolean, Number, DateTime, Array
valueType: BasicValueType;
// formula expressions
expression: string;
// false if the formula contains an error
hasError: boolean;
// depending on the type of field being referenced,
// you can customize the format,
// such as date, number, percentage, currency field, the specific format refers to the corresponding field write property
format?: {
type: 'DateTime' | 'Number' | 'Percent' | 'Currency',
format: Format
};
}
Field property write format
{
// formula expressions
expression?: string;
// depending on the type of field being referenced,
// you can customize the format,
// such as date, number, percentage, currency field, the specific format refers to the corresponding field write property
format?: {
type: 'DateTime' | 'Number' | 'Percent' | 'Currency',
format: Format
};
}
Currency
• Currency = "Currency"
An amount of a currency.
Cell read format
number
Cell write format
number
Field property read format
{
symbol?: string; // units of currency
precision?: number; // from 0 to 4 inclusive
defaultValue?: string;
symbolAlign?: 'Default' | 'Left' | 'Right'; // arrangement of units and values
}
Field property read format
{
symbol?: string; // units of currency
precision?: number; // from 0 to 4 inclusive
defaultValue?: string;
symbolAlign?: 'Default' | 'Left' | 'Right'; // arrangement of units and values
}
Percent
• Percent = "Percent"
A percentage.
Cell read format
number
Cell write format
number
Field property read format
{
precision: number; // from 0 to 4 inclusive
defaultValue?: string;
}
Field property write format
{
precision: number; // from 0 to 4 inclusive
defaultValue?: string;
}
SingleText
• SingleText = "SingleText"
A single line of text.
Cell read format
string
Cell write format
string
Field property read format
{
defaultValue?: string
}
Field property write format
{
defaultValue?: string
}
AutoNumber
• AutoNumber = "AutoNumber"
Automatically incremented unique counter for each record.
Cell read format
number
Cell write format
n/a
Field property read format
n/a
Field property write format
n/a
CreatedTime
• CreatedTime = "CreatedTime"
The time the record was created in UTC.
Cell read format
string
Cell write format
n/a
Field property read format
{
dateFormat: DateFormat;
timeFormat?: TimeFormat;
includeTime?: boolean;
}
Field property write format
{
dateFormat: DateFormat;
timeFormat?: TimeFormat;
includeTime?: boolean;
LastModifiedTime
• LastModifiedTime = "LastModifiedTime"
Shows the date and time that a record was most recently modified in any editable field or just in specific editable fields.
Cell read format
string
Cell write format
n/a
Field property read format
{
dateFormat: DateFormat;
timeFormat?: TimeFormat;
includeTime: boolean;
// the fields to check the last modified time of: 0 all editable, 1 specified field
collectType: CollectType;
// whether to specify the field, array type can specify more than one field, not fill for all
fieldIdCollection: string[];
}
Field property write format
{
dateFormat: DateFormat;
timeFormat?: TimeFormat;
includeTime?: boolean;
// the fields to check the last modified time of: 0 all editable, 1 specified field
collectType?: CollectType;
// whether to specify the field, array type can specify more than one field, not fill for all
fieldIdCollection?: string[];
}
CreatedBy
• CreatedBy = "CreatedBy"
The collaborator who created a record.
Cell read format
string
Cell write format
n/a
Field property read format
n/a
Field property write format
n/a
LastModifiedBy
• LastModifiedBy = "LastModifiedBy"
Shows the last collaborator who most recently modified any editable field or just in specific editable fields.
Cell read format
string
Cell write format
n/a
Field property read format
{
// the fields to check the last modified collaborator of: 0 all editable, 1 specified field
collectType?: CollectType;
// whether to specify the field, array type can specify more than one field, not fill for all
fieldIdCollection?: string[];
}
Field property write format
{
// the fields to check the last modified collaborator of: 0 all editable, 1 specified field
collectType?: CollectType;
// whether to specify the field, array type can specify more than one field, not fill for all
fieldIdCollection?: string[];
}
Cascader
• Cascader = "Cascader"
Cascader, select from a set of associated data collections
Cell read format
string
Cell write format
string
Field property read format
{
showAll: boolean;
linkedDatasheetId: string;
linkedViewId: string;
linkedFields: {
id: string;
name: string;
type: number;
}[],
fullLinkedFields: {
id: string;
name: string;
type: number;
}[];
}
Field property write format
{
showAll: boolean;
linkedDatasheetId: string;
linkedViewId: string;
linkedFields: {
id: string;
name: string;
type: number;
}[],
fullLinkedFields: {
id: string;
name: string;
type: number;
}[];
}
WorkDoc
• WorkDoc = "WorkDoc"
A rich text editor.
Cell read format
string
Cell write format
string
Field property read format
n/a
Field property write format
n/a
Button
• Button = "Button"
Button click trigger automation.
Cell read format
n/a
Cell write format
n/a
Field property read format
n/a
Field property write format
n/a