Add action for bulk update rows to tables block#2298
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new "Update Records Batch" action to the OpenOps Tables block, along with a supporting batchUpdateRows helper in the shared openops package. The helper chunks PATCH requests to Baserow's batch endpoint at 200 items per call (mirroring batchCreateRows), and the action resolves the table id and primary key field before delegating.
Changes:
- New
batchUpdateRowsfunction inpackages/openops/src/lib/openops-tables/rows.ts, plus a sharedMAX_BATCH_ROWSconstant reused from the previousMAX_BATCH_CREATE_ROWS. - New
updateRecordsBatchActionaction that validates inputs and callsbatchUpdateRows. - Wired the new action into the block registry and added unit tests for both the helper and the action.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/openops/src/lib/openops-tables/rows.ts | Adds batchUpdateRows helper and renames the chunk-size constant. |
| packages/openops/test/openops-tables/rows.test.ts | Adds tests for chunking and empty-input behavior of batchUpdateRows. |
| packages/blocks/openops-tables/src/actions/update-records-batch-action.ts | New action implementing the batch update workflow. |
| packages/blocks/openops-tables/src/index.ts | Registers the new action in the block. |
| packages/blocks/openops-tables/test/index.test.ts | Updates expected action count and asserts new action shape. |
| packages/blocks/openops-tables/test/actions/update-records-batch-action.test.ts | New tests covering happy path and input validation for the action. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| auth: BlockAuth.None(), | ||
| name: 'update_records_batch', | ||
| description: | ||
| 'Update multiple existing records in an OpenOps table. Note: rowId must be the internal Baserow row ID (integer from the "ID" field), not a custom primary key.', |
| displayName: 'Items', | ||
| required: true, | ||
| description: | ||
| 'An array of objects with rowId (Baserow internal row ID as integer) and fields keyed by table field names. Example: [{ rowId: 123, fields: { Owner: "user@example.com" } }]', |
There was a problem hiding this comment.
How do we get the Baserow internal row ID?
There was a problem hiding this comment.
Its automatically included when you get a baserow object, so when we do get records its already there
|


Fixes OPS-4325