The code block runs HTML, CSS and JavaScript you wrote yourself inside a sandboxed frame. Standing alone it is a widget: an animation, a gauge, a chart from a library we do not ship. On a record page it fills from the record being viewed, through named variables you define on the template, and it can run that record's actions.
Try it: Switch which Goal record the page is showing; the ring redraws from that row's variables.
Settings
Progress
Goal
Q1 revenue
€84k booked of a €120k target
Example. A code block on a Goal record page. In the real app this card is HTML, CSS and JavaScript the author wrote, running in a sandboxed frame: the ring is an SVG drawn from a pct variable, the title and subtitle come from two more formulas delivered as vars, and the app's colours and radius arrive as CSS custom properties. This is a static stand-in, not a live frame.
Create a code template on the Templates tab: a name, a scope (no data or record) and, for the record scope, the table. Scope and table are fixed at creation; the editor shows HTML, CSS and JS tabs with a live preview beside them.
Add variables: named formulas over the bound table's row, such as ROUND([Booked] / [Target] * 100), with the Expression Assistant behind each one. They reach the code as vars, already evaluated.
Declare what the code may do: the actions it can run, whether it may update, create or delete rows, and the views it may open. Anything undeclared is refused by the app.
Drop a Code block on a view, or on a record page, and pick the template. The frame says it is ready, the app answers with the record, the variables, the theme and the grants, and your code draws. Later changes arrive as further messages.
The code template to run. Standing alone the picker offers no-data templates; on a record page it offers record templates bound to the page's table.
Edit template
—
Jumps to the Templates tab with this template open: code, variables, capabilities and the live preview.
The sandbox
The frame has no origin of its own: no cookies, no access to the page around it, and no network unless the template lists the https hosts it may reach. Every write and every action goes back through the app, which checks the declaration and then the viewer's role permissions, exactly as a form or an action button would. The Code blocks guide has the full picture.
Like every block, this one also has the shared block settings: an optional title (which shows as a heading above the block) with a description under it, auto-height, conditional visibility, and role-based visibility, plus the source table and record-filter settings shared by all data blocks.