Views¶
You'll find below all the available methods to interact with the views of a SeaTable table.
Global structure¶
Here is the global structure of a view object:
{
"_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": []
}
Please refer to the SeaTable API Reference for a more detailed presentation.
Get View(s)¶
getActiveView
Get the current view of the active table.
Output Single view object
Example
getViewByName
Get a view of a particular table, specified by its name viewName.
table: either a table object or the table name
Output Single view object (undefined if no view called viewName exists, throws an error if table doesn't exist)
Example
listViews / getViews (deprecated)
Get all the views of the table.
table: either a table object or the table name
Output Array of view objects (throws an error if table doesn't exist)
Example
Add View¶
addView
Add a view named viewName to a table.
table: either a table object or the table name
Output Nothing (throws an error if table doesn't exist)
Example
Rename View¶
renameView
Rename a view in the table specified by its current name currentViewName and its new name nextViewName. Please ensure that you choose a nextViewName that doesn't already exists in your table.
table: either a table object or the table name
Output Nothing (throws an error if table or currentViewName doesn't exist)
Example
Delete View¶
deleteView
Delete a view in a particular table, specified by its name viewName. Deleting the last view is not possible.
table: either a table object or the table name
Output Nothing (throws an error if table doesn't exist or no view called viewName exists)
Example