Skip to main content

Prerequisites

Understand the Two Expression Notations

Powersheet supports two distinct expression syntaxes, each used in a different configuration context:
Rule of ThumbIf you are editing a data model YAML file (entity types, relationships), use $context. If you are editing a sheet configuration YAML file (sources, columns, formatters), use () =>.
diagram
1

Add a Dynamic Where Clause to a Source Query

Dynamic where clauses let you filter source data using runtime values such as the current document or the current date.Filter by the current document:
When the sheet loads inside a LiveDoc, only records whose Module equals the current moduleName are returned.Filter by today’s date (show only future items):
Date Format RequirementDynamic date values must return ISO 8601 format. Always call .toISOString() on Date objects. Returning a raw Date object will cause the query to fail silently.
Combine multiple document properties using template literals:
2

Set Dynamic Default Values with Entity Factory

Use entityFactory to pre-populate fields on newly created items with values resolved at runtime:
In this example, type is derived from the source entity’s type at runtime (for instance, a SystemRequirement source yields SystemRequirement_VerificationTestCase), while Status receives the static value Planned.
3

Add a Computed Column

The value property computes a column’s content from other properties on the current entity. On a column bound to a real property, the computed result is persisted back to the data source on save.
The expression reads entity properties through context.entity. In this case it multiplies count by rate each time the sheet refreshes. A computed column is read-only by definition, so there is no need to declare isReadOnly.To compute a value that is shown but never stored, prefix the binding key with $. Such a column is unbound — it has no property behind it — so declare its result type with valueType:
value is about data; render is about appearance.On a bound column, value modifies the underlying data — the computed result is saved. render only changes how an existing value is displayed and cannot supply content of its own. If the result should never be stored, make the column unbound with $ rather than reaching for render.
For the full walkthrough — result types, aggregation, and what an unbound column cannot do — see Add a Computed Column.
4

Add a Custom Renderer

Renderers produce custom HTML output for cell display. They do not affect persisted data.Inline render expression on a column:
Named renderer definition (reusable across columns):
Named renderers are defined in the top-level renderers section and referenced by name in the column render property.
5

Configure Conditional Formatting

Formatters apply styles to cells based on a boolean expression. Unlike value and render, formatter expressions use simplified syntax — they do not start with () =>.
Apply the formatter to a column:
The formatter context provides access to context.document, context.entity, and context.value.
6

Use Context Expressions in Data Model Constraints

In data model YAML files, use the $context notation to create dynamic constraints that filter relationship data based on the source entity’s properties.Filter linked items to the same document component:
When viewing a SystemRequirement from the “Braking” component, only DesignRequirement items from “Braking” documents are loaded.Filter by document name and folder:
Constrain picker to same document type:
Per-Row Evaluation$context constraints are evaluated per row. Different rows can produce different constraint values depending on their source entity’s properties. This enables context-sensitive filtering without separate configurations.

Context Object Reference

The context object provides different properties depending on where the expression is evaluated: Key context properties:
  • context.user — Current logged-in user (id, name)
  • context.document — Current document information (title, type, id, moduleName, moduleFolder, component)
  • context.entity — Current entity with all its properties, e.g., context.entity.severity
  • context.source — Parent/source entity — the level the current one was navigated from
  • context.row — The whole row, as context.row.entities[<level>] across every navigation level
  • context.value — Current cell’s display value. It is undefined inside a value expression, because that expression is what produces the value

Verification

After saving your configuration changes:
  1. Reload the sheet in Polarion
  2. For where clauses: verify that only matching records appear (try opening the sheet inside different documents)
  3. For computed columns: confirm the column shows correct values and updates when the properties it reads change. A bound value column persists its result on save; an unbound ($) column leaves the work item untouched
  4. For renderers: inspect cells for the expected HTML rendering
  5. For formatters: verify that styling applies when the condition is met and disappears when it is not
  6. For $context constraints: expand a relationship and confirm that only items matching the source entity’s document properties are loaded
You should now see dynamic values resolving correctly at runtime across all configured expression locations.

See Also

Last modified on August 31, 2026