Secondary Datasource Access in Vibe Code Blocks & more user properties

Currently, useRecord() and useCurrentRecordId() in a Vibe Code block are tightly coupled to the block’s single connected datasource. When a block is placed on a detail page, useCurrentRecordId() correctly returns the page record’s ID — but useRecord() queries the connected datasource, not the page record’s table.

Please allow Vibe Code blocks to read from a second datasource (or the current page record) independently of the block’s primary connected datasource.

Option A — Secondary datasource connection Allow a Vibe Code block to be connected to two datasources. The primary datasource drives useRecordCreate / useRecordUpdate. A secondary datasource exposes a read-only useContextRecord() hook scoped to the page record.

Option B — Expose page record fields directly Provide a useCurrentPageRecord(select) hook that always reads from the page’s own datasource, regardless of the block’s connected datasource. Similar to how useCurrentUser() works — but for the current page record.

This would be consistent with the existing mental model: useCurrentUser() gives you the user regardless of datasource, so useCurrentPageRecord() should give you the page record regardless of datasource.

Either of these options would unlock a whole class of context-aware blocks that need to both read context and write to a related table — a very common pattern in relational data models. Without it, blocks that span two related tables require unnecessary workarounds or architectural compromises.

Also, extending the functionality of useCurrentUser() would be fantastic. Right now this feature only returns profile fields (id, name, email, avatar), and no custom user fields. By making all user related fields available, like with the “Logged-in user” filter options, the VC block could be way more powerful IMHO (e.g. access to preferences, privileges, linked records, etc).

2 Likes

We are looking into this