Two Expression Notations
Powersheet uses two distinct expression notations depending on the configuration layer:Context Expression ($context)
Context expressions use dot-notation to access properties from the runtime context. They are used exclusively in data model configuration — specifically within constraint definitions on entity types and relationships.
How It Works
A$context expression is a property path that Powersheet resolves by traversing the context object at runtime. No JavaScript logic is supported — only direct property access via dot-separated keys.
Where It Is Used
Available Context Paths
Dynamic constraints with
$context are evaluated per-row. Different rows can produce different constraint values depending on their source entity’s properties. For example, a UserNeed in a “Braking” document produces different constraint values than one in a “Steering” document.Context Expression Examples
Filter linked items to the same document component as the source item:SystemRequirement from the “Braking” component, only DesignRequirement entities from “Braking” documents are loaded.
Filter linked items to the same document as the source item:
Complete Data Model Example with Context Expressions
SystemRequirement back-navigation to DesignRequirement entities filters by both module name and folder at load time, and additionally restricts picker results by document type.
Dynamic Value (() => expression)
Dynamic values use JavaScript arrow function syntax and are used in sheet configuration YAML files. They provide full JavaScript expressiveness for computing values, filtering data, and rendering content at runtime.
How It Works
A() => expression is a JavaScript arrow function that receives a context object. Powersheet evaluates the function at runtime and uses the returned value. The expression must be wrapped in quotes within the YAML to preserve the arrow function syntax.
Where It Is Used
Formatter expressions use a simplified syntax — they do not start with
() =>. The expression is evaluated as a boolean condition directly (e.g., "context.item.Probability <= 99").Context Availability by Location
Not all context properties are available in every location. The following table shows which context sub-objects are accessible in each usage location:Dynamic Value Examples
Where clause — filter by current document:Requirement entities whose document.moduleName matches the current document’s module name, scoping results to the active LiveDoc.
Where clause — filter by today’s date:
DesignRequirement entity in this sheet, the sourceType field is automatically populated with the Polarion work item type of the parent/source entity.
Formula — calculate a value from other item properties:
totalPrice column value is computed by multiplying quantity by unitPrice. This calculated value is persisted to the data source.
Renderer — custom HTML output:
warningStyle to cells where the Probability value is 99 or below. Note the simplified syntax without () =>.
The Context Object
The context object provides runtime information to dynamic expressions. Its structure is hierarchical, with properties progressively available depending on the evaluation scope.Context Object Structure
Context Tree Diagram
item,source,entity, andvalueare only available in per-cell contexts (formula,render,formatter,display)documentis available inwhereclauses andformatterexpressions- In
$contextexpressions (data model constraints), onlysourceand its sub-properties are available
Notation Comparison
The two expression systems serve complementary purposes. Understanding when to use each prevents configuration errors.Quick Reference
Complete Sheet Configuration Example
The following example demonstrates multiple dynamic value expression types in a single sheet configuration:- Filters the
Requirementsource by the current document’s module name and future due dates - Pre-fills the
sourceTypefield on new entities from the parent/source entity’s work item type - Calculates
totalPricefromquantityandunitPrice(persisted) - Displays the document title instead of a raw reference
- Renders linked items with bold formatting
- Highlights rows where
Probabilityis 99 or below
See Also
- Constraints — full reference on constraint configuration including stages, operators, and composition
- Columns — column configuration properties including
formula,render, anddisplay - Formatters — conditional formatting and style definitions
- Sources — source query configuration including
whereandentityFactory - Binding Syntax — dot-notation paths for column keys
- Navigation Directions — direct and back relationship directions
- Cardinality — how relationship cardinality affects expand patterns and column binding