Expression Notations Overview
Powersheet uses two distinct expression notations depending on the configuration file type:Context Expression ($context)
Context expressions use dot-notation to access properties from the runtime context object. They are used exclusively in data model configuration — specifically in constraint definitions. No JavaScript logic is supported; only direct property path access.
Where $context Is Used
Available Context Paths
Per-Row EvaluationDynamic constraints with
$context are evaluated per-row. Different rows can produce different constraint values depending on their source entity’s properties.$context Examples
Filter linked items to the same document component as the source item:
SystemRequirement from the “Braking” component, only DesignRequirement items from “Braking” documents are loaded.
Filter linked items to the same document as the source item:
Dynamic Value (() => expression)
Dynamic values use JavaScript arrow function syntax and are used in sheet configuration YAML. 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 enclosed in quotes in the YAML configuration.
Where () => Is Used
formula is deprecated. Use value.Both names mean exactly the same thing, and existing configurations keep working unchanged, but formula is deprecated. Write value in new configurations. Declaring both on one column is rejected. See Computed Columns.Formatter ExceptionFormatter expressions use a simplified syntax — they do not start with
() =>. The expression is evaluated as a boolean condition directly (e.g., "context.entity.Risk > 50").The Context Object
The context object provides runtime information to dynamic expressions. Its structure is hierarchical, and properties are progressively available depending on the evaluation scope.Context Availability by Location
Not all context properties are available in every expression location. The following table shows which properties are accessible where:context.item is deprecated because it’s ambiguous — in some cell expressions it’s the entity, in others the whole row. Use context.entity or context.row instead; each always means exactly one thing.
A computed column starts from no cell value.
context.value is undefined inside a value expression, whether the column is bound or unbound, because the cell has nothing stored yet. Read what you need from context.entity instead.Only an unbound column’s value expression receives context.row and context.source. A bound value column is evaluated as a calculated property of the entity alone, with no row behind it.Context Properties Reference
Expression Examples by Use Case
Source Query Filtering (where)
Filter to items in the current document module:
Entity Factory (Default Values for New Items)
Derive default values from the parent (source) entity:entityFactory uses context.source to access properties of the parent entity that triggered the row creation. Static values (like status: Draft above) and dynamic expressions can be mixed freely in the same entityFactory block.
Column Value (Computed Columns)
Compute a value from other entity properties and store it in the bound property:isReadOnly.
Concatenate string properties:
$ to make the column unbound. It has no property behind it, so declare the result type with valueType:
Column Render (Display-Only HTML)
Bold rendering of a cell value:Named Renderers
Render a collection of linked items as a comma-separated list:Column Display (Navigation Property Override)
Thedisplay property overrides what users see for a navigation column without changing the underlying data binding. It is the most common location for short, focused () => expressions.
Show the linked entity’s title or fall back to its name:
titleOrName is a convenient idiom for entities that may have either a title (work items with rich descriptions) or only a name (lightweight reference entities).
Show only the title of the linked entity:
Conditional Formatting (Formatters)
Highlight rows where probability is below a threshold:() => prefix. They are evaluated directly as boolean conditions. The formatter references a style definition.
Complete YAML Example
A full sheet configuration demonstrating multiple dynamic expression patterns:Quick Reference
Common Patterns and Edge Cases
Combining Static and Dynamic Values
InentityFactory, static and dynamic values coexist. Only values with the () => prefix are evaluated at runtime:
Multiple $context Constraints
You can combine multiple $context paths in a single constraint block to narrow the filter:
Display Variants for the Same Navigation Column
A single navigation column can render very differently depending on thedisplay expression. The same binding systemRequirements.systemRequirement can show:
display whenever you need to change only how a linked entity appears in a cell, without changing the underlying binding path or affecting other views.
Date Handling
Date comparisons require ISO 8601 format. Always call.toISOString() on Date objects:
Nested Navigation in Render Expressions
When rendering values from expanded entities,context.value contains the resolved data. For collections, use .map() and .join():
Related Pages
- Binding Syntax — column key path structure, navigation patterns, and the
$unbound marker - Columns — full column property reference including
value,valueType,render, anddisplay - Add a Computed Column — step-by-step guide to stored and display-only computed columns
- Formatters — conditional formatting configuration and style references
- Styles — style definitions used by formatters and column headers
- Sources — data source configuration including
query.whereandentityFactory - Render Property — detailed reference for custom rendering
- Display Property — display override for navigation property columns
- Constraints — constraint configuration where
$contextexpressions are used - Context Expressions Reference — extended reference on
$contextpaths in data models