Undo and history
Every write is recorded with who made it and how it arrived. Undo a change from the API, read a record's history, and restore a deleted table or field from the trash.
Every write to an app, from the grid, a key, an agent or a builder, is recorded: who, when, how it arrived, and each record before and after. A record’s history, the change list and undo all come from that one record of changes.
Undo a change
In an app, changesets.mine lists the changes you made that you can still see, newest
first, and says for each whether it can be undone (revertible) and, when not, where it is
changed back instead. changesets.undo takes one back.
GET https://your-suite.gtable.app/your-app/v1/changesets
POST https://your-suite.gtable.app/your-app/v1/changesets/{changesetId}/revertIn the Studio, a builder lists and undoes every change of an app:
GET https://studio.gtable.app/v1/apps/{appId}/changesets
POST https://studio.gtable.app/v1/apps/{appId}/changesets/{changesetId}/revertWhat to expect:
- One request is one change. A batch of 500 creates, a bulk delete or a SQL update is one entry, undone in one step.
- All of it or none of it. Every row is put back in one transaction. A row deleted since
cannot be restored and is listed in
skippedwith the reason (status: "partly reverted"); any other refusal undoes nothing. - A deleted record comes back whole: same id, same autonumber, its links to records that still exist, and its comments.
- Someone changed it since? The first attempt is refused with a sentence naming the field
and whether it was you. Send
confirm: trueto go ahead. - An undo is itself a change, so undoing an undo is just undo again.
- Record creates, edits and deletes can be undone this way. Comments, saved views, pages and the app’s tables and fields are changed back elsewhere, and the list says where.
A record’s history
records.history returns one entry per field that actually moved, plus when the record was
created, commented on or deleted. A field you cannot read produces no entry you can see.
The trash
Deleting a table or a field is not undone from the change list, but it is not lost either: what
it held goes to the app’s trash for thirty days. trash.restore puts it back with the same ids,
values, links and the rules that named it.
GET https://studio.gtable.app/v1/apps/{appId}/trash
POST https://studio.gtable.app/v1/apps/{appId}/trash/{trashId}/restoreA deleted app can be restored for thirty days too, with apps.restore.