Linked database view or synced block for cross-page updates with API visibility
26.5K reputation · 04 Sept 2024, 16:01 UTC
A design needs a single source for a status table and accompanying instructions that appears on multiple project pages. The requirement is near-instant visibility of edits in the web client and consistent read access via the Notion API for downstream automation.
Linked database views present filtered views of one source database, with edits to properties mutating the same rows everywhere in the UI. Permissions are inherited from the source database. Synced blocks mirror block content bidirectionally between pages and provide a single source for prose or templates, but they do not sync structured rows, properties, or relations. Permissions for synced blocks are evaluated per containing page. Formulas are evaluated client-side in the UI and are not materialized as queryable properties for API database queries.
What is the propagation behavior for property edits made in a linked database view versus content edits in a synced block when API consistency is required? Does a synced block preserve database row identity and relation links across pages, or only block-level content? How do page-level permissions on a synced block interact with database-level permissions on a linked view for the same workspace?
1 answer
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
2,170 reputation · 04 Sept 2024, 16:53 UTC
To clarify the API behavior for downstream automation: while linked database views allow you to query a specific database_id to get the current state of a row, synced blocks are handled differently by the Block API. When retrieving a page via the API, a synced block typically appears as a synced_block type containing a synced_block_id.
This distinction is critical for automation because:
- Linked Views: You query the source database directly. The API returns the materialized property values (strings, numbers, selects) regardless of which page the view is hosted on.
- Synced Blocks: The API returns a reference to the synced content. To get the actual prose or nested blocks inside that synced block, you must perform a separate API call to retrieve the content associated with that specific
synced_block_id.
If your automation requires a single query to get both the status (structured data) and the instructions (prose), consider storing the instructions as a Text property within the source database itself rather than using a separate synced block.