mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-01-06 22:03:59 -05:00
feat(blocks): add many new spreadsheet blocks (#11574)
<!-- Clearly explain the need for these changes: -->
We have lots we want to do with google sheets and we don't want a lack
of blocks to be a limiter so I pre-ddi a lot of blocks!
### Changes 🏗️
Adds 24 new blocks for google sheets (tested and working)
```
|-----|-------------------------------------------|----------------------------------------|
| 1 | GoogleSheetsFilterRowsBlock | Filter rows based on column conditions | ✅ |
| 2 | GoogleSheetsLookupRowBlock | VLOOKUP-style row lookup | ✅ |
| 3 | GoogleSheetsDeleteRowsBlock | Delete rows from a sheet | ✅ |
| 4 | GoogleSheetsGetColumnBlock | Get data from a specific column | ✅ |
| 5 | GoogleSheetsSortBlock | Sort sheet data | ✅ |
| 6 | GoogleSheetsGetUniqueValuesBlock | Get unique values from a column | ✅ |
| 7 | GoogleSheetsInsertRowBlock | Insert rows into a sheet | ✅ |
| 8 | GoogleSheetsAddColumnBlock | Add a new column | ✅ |
| 9 | GoogleSheetsGetRowCountBlock | Get the number of rows | ✅ |
| 10 | GoogleSheetsRemoveDuplicatesBlock | Remove duplicate rows | ✅ |
| 11 | GoogleSheetsUpdateRowBlock | Update an existing row | ✅ |
| 12 | GoogleSheetsGetRowBlock | Get a specific row by index | ✅ |
| 13 | GoogleSheetsDeleteColumnBlock | Delete a column | ✅ |
| 14 | GoogleSheetsCreateNamedRangeBlock | Create a named range | ✅ |
| 15 | GoogleSheetsListNamedRangesBlock | List all named ranges | ✅ |
| 16 | GoogleSheetsAddDropdownBlock | Add dropdown validation to cells | ✅ |
| 17 | GoogleSheetsCopyToSpreadsheetBlock | Copy sheet to another spreadsheet | ✅ |
| 18 | GoogleSheetsProtectRangeBlock | Protect a range from editing | ✅ |
| 19 | GoogleSheetsExportCsvBlock | Export sheet as CSV | ✅ |
| 20 | GoogleSheetsImportCsvBlock | Import CSV data | ✅ |
| 21 | GoogleSheetsAddNoteBlock | Add notes to cells | ✅ |
| 22 | GoogleSheetsGetNotesBlock | Get notes from cells | ✅ |
| 23 | GoogleSheetsShareSpreadsheetBlock | Share spreadsheet with users | ✅ |
| 24 | GoogleSheetsSetPublicAccessBlock | Set public access permissions | ✅ |
```
<!-- Concisely describe all of the changes made in this pull request:
-->
### Checklist 📋
#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
<!-- Put your test plan here: -->
- [x] Tested using the attached agent
[super test for
spreadsheets_v9.json](https://github.com/user-attachments/files/24041582/super.test.for.spreadsheets_v9.json)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Introduces a large suite of Google Sheets blocks for row/column ops,
filtering/sorting/lookup, CSV import/export, notes, named ranges,
protections, sheet copy, and sharing/public access, plus refactors
append to a simpler single-row append.
>
> - **Google Sheets blocks (new)**:
> - **Data ops**: `GoogleSheetsFilterRowsBlock`,
`GoogleSheetsLookupRowBlock`, `GoogleSheetsDeleteRowsBlock`,
`GoogleSheetsGetColumnBlock`, `GoogleSheetsSortBlock`,
`GoogleSheetsGetUniqueValuesBlock`, `GoogleSheetsInsertRowBlock`,
`GoogleSheetsAddColumnBlock`, `GoogleSheetsGetRowCountBlock`,
`GoogleSheetsRemoveDuplicatesBlock`, `GoogleSheetsUpdateRowBlock`,
`GoogleSheetsGetRowBlock`, `GoogleSheetsDeleteColumnBlock`.
> - **Named ranges & validation**: `GoogleSheetsCreateNamedRangeBlock`,
`GoogleSheetsListNamedRangesBlock`, `GoogleSheetsAddDropdownBlock`.
> - **Sheet/admin**: `GoogleSheetsCopyToSpreadsheetBlock`,
`GoogleSheetsProtectRangeBlock`.
> - **CSV & notes**: `GoogleSheetsExportCsvBlock`,
`GoogleSheetsImportCsvBlock`, `GoogleSheetsAddNoteBlock`,
`GoogleSheetsGetNotesBlock`.
> - **Sharing**: `GoogleSheetsShareSpreadsheetBlock`,
`GoogleSheetsSetPublicAccessBlock`.
> - **Refactor**:
> - Rename and simplify append: `GoogleSheetsAppendRowBlock` (replaces
multi-row/dict input with single `row`), fixed insert option to
`INSERT_ROWS` and streamlined response.
> - **Utilities/Enums**:
> - Add helpers (`_column_letter_to_index`, `_index_to_column_letter`,
`_apply_filter`) and enums (`FilterOperator`, `SortOrder`, `ShareRole`,
`PublicAccessRole`).
> - Drive/Sheets service builders and file validation reused across new
blocks.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
6e9e2f4024. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
This commit is contained in: