Prerequisites
- A working sheet configuration YAML file
- Familiarity with the sheet configuration reference and data model reference
Understand the Two Expression Notations
Powersheet supports two distinct expression syntaxes, each used in a different configuration context: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 Combine multiple document properties using template literals:
Module equals the current moduleName are returned.Filter by today’s date (show only future items):2
Set Dynamic Default Values with Entity Factory
Use In this example,
entityFactory to pre-populate fields on newly created items with values resolved at runtime: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 The expression reads entity properties through For the full walkthrough — result types, aggregation, and what an unbound column cannot do — see Add a Computed Column.
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.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: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 Apply the formatter to a column:The formatter context provides access to
value and render, formatter expressions use simplified syntax — they do not start with () =>.context.document, context.entity, and context.value.6
Use Context Expressions in Data Model Constraints
In data model YAML files, use the When viewing a Constrain picker to same document type:
$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:SystemRequirement from the “Braking” component, only DesignRequirement items from “Braking” documents are loaded.Filter by document name and folder:Context Object Reference
Thecontext 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.severitycontext.source— Parent/source entity — the level the current one was navigated fromcontext.row— The whole row, ascontext.row.entities[<level>]across every navigation levelcontext.value— Current cell’s display value. It isundefinedinside avalueexpression, because that expression is what produces the value
Verification
After saving your configuration changes:- Reload the sheet in Polarion
- For where clauses: verify that only matching records appear (try opening the sheet inside different documents)
- For computed columns: confirm the column shows correct values and updates when the properties it reads change. A bound
valuecolumn persists its result on save; an unbound ($) column leaves the work item untouched - For renderers: inspect cells for the expected HTML rendering
- For formatters: verify that styling applies when the condition is met and disappears when it is not
- For $context constraints: expand a relationship and confirm that only items matching the source entity’s document properties are loaded
See Also
- Add a Computed Column —
value, the$unbound marker, andvalueTypein depth - Configure Sources — set up data source queries including where clauses
- Configure a Formatter — conditional styling reference
- Apply Column Styles — define reusable style objects
- Configure Constraints — full constraint configuration including
$contextpatterns - Sheet Configuration Reference — complete property reference for sheet YAML
- Data Model Reference — entity types, relationships, and constraint configuration