Data structure
-
Base, that is, an AI Table document.
-
baseIduniquely identifies an AI Table document. You can obtainbaseIdin the following ways.Obtain from URL Obtain from the document information panel Obtain through other APIs Call the Get node list API. Note When an AI Table is created, the value of docTypeisBASE.
-
-
Sheet (the table). An AI Table document usually contains multiple tables, and must contain at least one table.
- All APIs that need to access a sheet can use either
sheetIdorsheetNameas the input parameter. - You can obtain
sheetIdby calling the Get all tables API.
- All APIs that need to access a sheet can use either
Note
sheetId is unique only within the document and is not globally unique.
-
sheetNameis the sheet name visible on the front end, such asTask managementin the figure below. -
Field. Each column in a table is a field, and a table usually contains multiple fields.
- All APIs that need to access a field can use either
fieldIdorfieldNameas the input parameter. - You can obtain
fieldIdby calling the Get all fields API.
- All APIs that need to access a field can use either
Note
fieldId is unique only within the document and is not globally unique.
-
fieldNameis the field name visible on the front end, such asPriorityin the figure below. -
The first column of each sheet is the “primary field”. It supports only specific field types and cannot be deleted. To view the supported field types:
- Open any AI Table.
- Edit the primary field.
- View the configurable field types.
-
Record. Each row in a table is a record, and a table usually contains multiple records.
- All APIs that need to access a record must use
recordId. - You can obtain
recordIdby calling APIs such as Insert records or List records.
- All APIs that need to access a record must use
Note
recordId is unique only within the document and is not globally unique.
Field attributes
The field attribute area is shown in the figure below. For the attributes supported by different field types, refer to the following table.| Field name | Type (type) | Attribute (property) |
|---|---|---|
| Text | text | None |
| Number | number | formatter values: INT / FLOAT_1 / FLOAT_2 / FLOAT_3 / FLOAT_4 (keep N decimal places) / THOUSAND / THOUSAND_FLOAT (thousands separator) / PERCENT / PERCENT_FLOAT (percent) |
| Currency | currency | currencyType: CNY / HKD / USD / EUR / GBP / MOP / VND / JPY / KRW / AED / AUD / BRL / CAD / CHF / INR / IDR / MXN / MYR / PHP / PLN / RUB / SGD / THB / TRY / TWD; formatter values: INT / FLOAT_1 … FLOAT_4 |
| Select | singleSelect | { choices: [{ name: "optionName1" }, { name: "optionName2" }] } |
| Multiselect | multipleSelect | Same as “Select”. |
| Date | date | formatter values: YYYY-MM-DD / YYYY-MM-DD HH:mm / YYYY/MM/DD / YYYY/MM/DD HH:mm |
| User | user | { multiple: boolean } (multiselect supported; defaults to true) |
| Department | department | { multiple: boolean } (multiselect supported; defaults to true) |
| Attachment | attachment | None |
| One-way Link | unidirectionalLink | { multiple: boolean, linkedSheetId: "xxx" } (linkedSheetId is the linked table ID) |
| Both-way Link | bidirectionalLink | { multiple: boolean, linkedSheetId: "xxx", linkedFieldId: "yyy" } (do not pass linkedFieldId when creating the field) |
| Link | url | None |
Record value format
The record value (also known as field value) display is shown in the figure below. For the formats used by different field types, refer to the following table.| Field name | Type (type) | Set value (format used when inserting or updating records) | Return value (format returned when the record value is returned) |
|---|---|---|---|
| Text | text | "TextString" (string) | "TextString" (string) |
| Number | number | 123 (supports integer / float / string) | "123" (numeric value returned as a string) |
| Currency | currency | 123 (supports integer / float / string) | "123" (numeric value returned as a string) |
| Select | singleSelect | "optionName1" (option name) | { "id": "id", "name": "optionName1" } (id is the option ID; name is the option name) |
| Multiselect | multipleSelect | ["optionName1", "optionName2"] (option names) | [{ "id": "id1", "name": "optionName1" }, { "id": "id2", "name": "optionName2" }] |
| Date | date | 1688601600000 (timestamp) or "2023-12-20 03:00" (ISO 8601 string) | 1688601600000 (timestamp) |
| User | user | [{ unionId: "xxx" }] | [{ unionId: "xxx" }] |
| Department | department | [{ deptId: "xxx" }] | [{ deptId: "xxx" }] |
| Attachment | attachment | For details, refer to Upload attachment. | [{ "filename": "image.xlsx", "size": 92250, "type": "xls", "url": "xxx" }] Note url is the attachment access link. When the attachment is an online document, the link points to the online document and never expires. When the attachment is another type of file, the link is a download link with a limited validity period, and becomes inaccessible after some time. |
| One-way Link | unidirectionalLink | { "linkedRecordIds": ["xxx", "yyy"] } | { "linkedRecordIds": ["xxx", "yyy"] } Note The field property contains the linked sheetId. Together with the recordId returned here, you can call the Get record API to retrieve the values of the linked records. |
| Both-way Link | bidirectionalLink | { "linkedRecordIds": ["xxx", "yyy"] } | { "linkedRecordIds": ["xxx", "yyy"] } |
| Link | url | { "text": "Dingtalk", "link": "https://dingtalk.io" } | { "text": "Dingtalk", "link": "https://dingtalk.io" } |