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 Calculated Column with Formula
The The expression accesses entity properties through
formula property computes a value from other properties on the current entity. The computed value is persisted back to the data source on save.context.item. In this case it multiplies quantity by unitPrice each time the sheet refreshes.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
formula and render, formatter expressions use simplified syntax — they do not start with () =>.context.document, context.item, 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.item— Current entity with all its properties, e.g.,context.item.StoryPointscontext.source— Parent/source entity in relationship contexts, including itstypecontext.value— Current cell’s display 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 formulas: confirm the calculated column shows correct values and updates when source fields change
- 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
- 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