Create, replace or delete a data table
set_dataAttach a data table to a page, replace it entirely, delete it, or open/close reader write-back. Tables are independent of versions: editing data never republishes the page and pushing a new version never changes tables. Call get_data first and pass the revision back unchanged: 0 creates, the current value updates; a mismatch is rejected (409) and requires re-reading, never blind overwrites. Provide rows (array of objects, optional columns for order) or csv (text, first line headers), not both; delete=true removes the table and its appended rows. append_open=true lets viewers append one row from the page with a plain form or POST ./_data/ (or the optional SDK space.data.append) (sign-ups, check-ins, votes, feedback): off by default, per table; passing append_open alone only flips the switch. Appended rows are rate-limited, moderated before other viewers see them, and readable only through list_data_rows; rows the author or another workspace member submits while signed in on the live page carry by=member. members_only=true accepts rows from workspace members only (visitors get 403) and, like append_open, can be passed on its own. Table names start with a lowercase letter and contain only letters, digits and underscores. The receipt states the per-table, per-page and workspace limits with current usage.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| csv | No | CSV text, first line is the header; either this or rows | |
| rows | No | Array of objects, one per row, keys are column names; either this or csv | |
| table | Yes | Table name, e.g. items or sales_2026 | |
| delete | No | true = delete this table (no rows or csv needed) | |
| columns | No | Optional: column order and selection (rows only) | |
| revision | Yes | 0 to create; the current value from get_data to replace or delete | |
| append_open | No | 读者写回开关:true 开、false 关。单独传 = 只翻开关(底表不动,仍要带 revision) | |
| proposal_id | Yes | ||
| members_only | No | Accept write-back from workspace members only: when true, visitor submissions get 403. Passed alone = only flips the switch (`revision` still required) |