Skip to content

Add action for bulk update rows to tables block#2298

Merged
bigfluffycookie merged 3 commits into
mainfrom
lb/updatebulk
May 18, 2026
Merged

Add action for bulk update rows to tables block#2298
bigfluffycookie merged 3 commits into
mainfrom
lb/updatebulk

Conversation

@bigfluffycookie
Copy link
Copy Markdown
Contributor

Fixes OPS-4325

@linear
Copy link
Copy Markdown

linear Bot commented May 17, 2026

OPS-4325

@bigfluffycookie bigfluffycookie marked this pull request as ready for review May 17, 2026 09:35
Copilot AI review requested due to automatic review settings May 17, 2026 09:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 batchUpdateRows function in packages/openops/src/lib/openops-tables/rows.ts, plus a shared MAX_BATCH_ROWS constant reused from the previous MAX_BATCH_CREATE_ROWS.
  • New updateRecordsBatchAction action that validates inputs and calls batchUpdateRows.
  • 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.

Comment thread packages/openops/src/lib/openops-tables/rows.ts
Comment thread packages/openops/test/openops-tables/rows.test.ts
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.',
Copy link
Copy Markdown
Contributor

@ravikiranvm ravikiranvm May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need the 'Note' here. It looks too descriptive in the UI.

Image

Maybe the description of 'item' property is enough or if that's not clear enough, maybe make it more clear.

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" } }]',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we get the Baserow internal row ID?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its automatically included when you get a baserow object, so when we do get records its already there

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 18, 2026

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@bigfluffycookie bigfluffycookie merged commit 27fda36 into main May 18, 2026
21 checks passed
@bigfluffycookie bigfluffycookie deleted the lb/updatebulk branch May 18, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants