Login
Free Sign Up
Docs
/

Entity Context

An entity context wraps a region of an Experience so that descendant blocks (Input, Button, and Text blocks) can read from and write to the same underlying Record. Configure it from the Entity Context section of the block settings panel on any block that supports the entityContext prop (such as Box, Button, or Link blocks).

Settings Panel

Open the Entity Context section of the block settings panel. With the toggle enabled you can configure:

  • Name — display name for the datum (defaults to the Schema name).
  • Literal — author the Schema inline rather than referencing a Schema in the Space.
  • Schema — pick the Schema this entity context represents.
  • Lookup — how the Record is loaded.
  • Field overrides — per-field defaults and enforced values applied at render and save time.

Lookup Mode

The Lookup selector chooses how the Record is loaded:

Mode

Meaning

None

The entity context is in-memory only.

By Id

Reads a Record ID from a datum reference (for example, a URL parameter or parent query result) and fetches that Record.

By Query

Runs a filter against the Schema and uses the first match. If no Record matches, the entity context enters the new state — defaults are applied and a CRUD save will create the Record.

Switching modes preserves the configuration for the side you switch back to whenever possible (an existing query filter is kept while you visit By Id mode, for example).

The By Query mode reuses the same filter builder used by query blocks, so any combination of property and relationship filters is available.

Field Overrides

Field overrides are an ordered list of { mode, schemaPath, value } entries.

  • Default seeds an initial value when the entity context is in the new state. The user can still edit the field.
  • Enforce locks the field — bound Input blocks render read-only and the value is always sent on save.

For each row you can:

  • Toggle between Default and Enforce.
  • Pick the target Schema path (data fields and relationship fields are both selectable).
  • Edit the value as a literal or a datum reference. The override editor does not support contextValue.
  • Reorder the row up or down, or remove it.

Set Field Overrides from Query

When the lookup is in By Query mode, a From Query button appears next to Add. It inspects the current filter and proposes enforce overrides derived from it:

Filter shape

Generated override

relationship with fromId

enforce on the queried Schema's toSchemaPath (the property holding the FROM ID).

relationship with toId

enforce on the queried Schema's fromSchemaPath (the property holding the TO ID).

property with eq

enforce on the property path with the same value.

The button opens a preview popover showing:

  • Overrides that will be appended to the existing list.
  • Overrides that are skipped because the same schemaPath is already configured. Existing hand edits are never silently overwritten — you can remove the conflicting row first if you want the derived value to win.

Click Append N to apply, or Cancel to discard.

Migrating Legacy Configurations

Earlier versions stored the lookup as lookupEntityById / lookupEntityByIdSource. These are converted automatically to the lookup: { mode: "id", idSource } shape, and the editor saves the new shape on the next write. No manual migration is required — opening and saving any affected Experience is sufficient.