Skip to main content
The app reads the Drive file version, fetches one grid range and its tab metadata, and then reads the Drive version again. It publishes the draft only when Drive returns the same file version on both reads. If the version moves, the last committed position stays in place and the next pass starts with a new version check. Workbook writers use Google Sheets as usual. Google documents headRevisionId for binary Drive files. For Google spreadsheets the check uses the file resource’s monotonically increasing version. This is a check around a live Sheets read. Historical revision downloads and cross-API snapshot isolation are outside the contract. Formulas land as entered text rather than recalculated output.

Mount and bind

sheets({ data, drive, provider }) returns the app to place at a path of your tree. Bind the Drive version check and the grid read for the same spreadsheet.
app.ts
sheets.operator is granted from code: ctx.grant(sheets.operator, { to, under }) in one of your mutations (Grants). Use scoped read-only credentials: drive.metadata.readonly for the Drive file check and spreadsheets.readonly for the grid read. Both receivers must select the same spreadsheet and live under the mount’s data label. The mount’s operator role clears it and is the only role its functions allow. The range uses zero-based coordinates and admits up to 64 rows, 16 columns, 512 cells total, and 36 KiB per response. Blank cells are null. Rows are keyed by workbook, tab, Drive version, row, starting column, and width. The app publishes the rows, tab metadata, and the Drive version position together and retains earlier versions. A tab or row omission does not delete prior observations. To change the installed range, call sheets.source.advance with the new selection and the source configuration revision from source.health. Drive file versions Sheets spreadsheet reads