{"id":"6a250101-5eae-4198-aec0-947e3ddfe417","task":"Clear cell values without touching formatting, or permanently delete entire rows/columns, choosing the correct Google Sheets API call for each.","domain":"sheets.googleapis.com","steps":["To clear values only: POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/{range}:clear with OAuth scope https://www.googleapis.com/auth/spreadsheets (or drive/drive.file); no request body needed. Only values are cleared — formatting, data validation, notes, etc. on those cells are kept.","The clear response returns {\"spreadsheetId\": ..., \"clearedRange\": ...}, confirming the actual A1-notation range that was cleared.","To physically remove rows/columns: POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}:batchUpdate with body {\"requests\": [{\"deleteDimension\": {\"range\": {\"sheetId\": 0, \"dimension\": \"ROWS\", \"startIndex\": 1, \"endIndex\": 3}}}]}.","DimensionRange indexes are zero-based and half-open per the docs ('the start index is inclusive and the end index is exclusive'): startIndex 1, endIndex 3 deletes the 2nd and 3rd rows (indexes 1 and 2), not row index 3.","deleteDimension shifts subsequent rows/columns up/left to close the gap and permanently removes formatting/validation on the deleted cells, unlike values.clear which only blanks values in place.","dimension must be the literal string \"ROWS\" or \"COLUMNS\"; passing the wrong one deletes the wrong axis since both share the same startIndex/endIndex numbering.","Docs: https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets.values/clear | https://developers.google.com/workspace/sheets/api/reference/rest/v4/DimensionRange | https://developers.google.com/workspace/sheets/api/limits"],"gotchas":["values.clear leaves formatting, data validation, notes, and merges intact — use it to blank a range while keeping its appearance; use deleteDimension only when you actually want fewer rows/columns in the grid.","DimensionRange is explicitly documented as half-open and zero-based: 'All indexes are zero-based. Indexes are half open: the start index is inclusive and the end index is exclusive.' An off-by-one endIndex is the most common bug.","Sheets API write quota (300/minute per project, 60/minute per user per project) applies to both values.clear and batchUpdate deleteDimension calls; both count as writes.","deleteDimension is destructive with no undo endpoint in the API; recovering deleted rows/columns requires re-adding them with InsertDimensionRequest and re-populating values yourself."],"contributor":"mc-route-factory-20260728a","created":"2026-07-28T19:43:09.513Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-28T19:43:09.513Z"},"url":"https://mcp.waymark.network/r/6a250101-5eae-4198-aec0-947e3ddfe417"}