Tables¶
You'll find below all the available methods to interact with the tables of a SeaTable base.
Global structure¶
Here is the global structure of a table object:
{
"_id": "IfcB",
"name": "New table",
"is_header_locked": false,
"summary_configs": {},
"columns": [ // (1)!
{
"key": "0000",
"type": "number",
"name": "First column",
"editable": true,
"width": 200,
"resizable": true,
"draggable": true,
"data": null,
"permission_type": "",
"permitted_users": []
},
{
"key": "2w6F",
"type": "text",
"name": "second column",
"editable": true,
"width": 200,
"resizable": true,
"draggable": true,
"data": null,
"permission_type": "",
"permitted_users": []
},
{
"key": "3aAf",
"type": "date",
"name": "third column",
"editable": true,
"width": 200,
"resizable": true,
"draggable": true,
"data": null,
"permission_type": "",
"permitted_users": []
}
],
"rows": [], // (2)!
"views": [ // (3)!
{
"_id": "0000",
"name": "Default View",
"type": "table",
"is_locked": false,
"filter_conjunction": "And",
"filters": [],
"sorts": [],
"groupbys": [],
"group_rows": [],
"groups": [],
"colorbys": {},
"hidden_columns": [],
"rows": [],
"formula_rows": {},
"link_rows": {},
"summaries": {},
"colors": {}
}
],
"id_row_map": {}
}
-
Array of existing columns
-
Array of existing rows
-
Array of existing views
Please refer to the SeaTable API Reference for a more detailed presentation.{ "_id": "0000", "name": "Default View", "type": "table", "is_locked": false, "rows": [], "formula_rows": {}, "summaries": [], "filter_conjunction": "And", "sorts": [], "filters": [], "hidden_columns": [], "groupbys": [], "group_rows": [], "groups": [] }
You can have a look at the specific view, column or row structure on the corresponding pages.
Get Table(s)¶
getActiveTable
Get the currently selected table.
Output Single table objectExample
getTables
Get all tables of the current base.
Output Array of table objectsExample
getTableByName
Get a table object by its name.
Output Single table object (undefined if table doesn't exist)
Example
Add Table¶
addTable
Add a new table to this base, given the new table name tableName. Please ensure that you choose a tableName that doesn't already exists in your base.
Example
Rename Table¶
renameTable
Rename an existing table named oldName to newName. Please ensure that you choose a newName that doesn't already exists in your base.
Output Nothing (throws an error if no table named oldName exists)
Example
Delete Table¶
deleteTable
Delete a table named tableName from the base. By the way, the table can be restored from the logs. Deleting the last table is not possible.
tableName exists) Example