Nextedy POWERSHEET configurations support dynamic value expressions — values resolved at runtime based on the current context such as the active document, the logged-in user, URL parameters, or t
If you are editing a domain model YAML file (domainModelTypes, relationships), use $context. If you are editing a sheet configuration YAML file (sources, columns, formatters), use () =>.
Context expressions use dot-notation to access properties from the runtime context. They are used exclusively in domain model configuration — specifically within constraint definitions on entity types and relationships.
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.
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.
When viewing a SystemRequirement from the “Braking” component, only DesignRequirement entities from “Braking” documents are loaded.Filter linked items to the same document as the source item:
This restricts loaded entities to the exact same LiveDoc document as the source entity, matching on both module name and folder.Filter picker options by source document type:
In this model, 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 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.
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.
formula affects persisted data — the calculated value is saved back to the data source. Use render if you only need to change how a value is displayed without modifying the underlying data.
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").
The sheet loads only Opportunity entities whose Client field matches the client URL parameter value.Where clause — filter by today’s date:
where: DueDate: ">": "() => new Date().toISOString()"
The resulting value must be in the correct format for the data type. For date fields, use .toISOString() to produce the ISO 8601 string that Polarion expects.
Template literal syntax allows concatenating multiple URL parameters into a single filter value.Entity factory — set initial value from a URL parameter:
When a user creates a new UserNeed entity in this sheet, the Client field is automatically populated with the value of the client URL parameter.Formula — calculate a value from other item properties:
The totalPrice column value is computed by multiplying quantity by unitPrice. This calculated value is persisted to the data source.Renderer — custom HTML output:
The context object provides runtime information to dynamic expressions. Its structure is hierarchical, with properties progressively available depending on the evaluation scope.
context +-- parameters URL and configuration parameters (key-value pairs) | +-- {paramName} e.g., context.parameters.client +-- user Current logged-in user | +-- id | +-- name +-- sources All configured data source definitions +-- document Current document information | +-- title | +-- type | +-- id | +-- moduleName | +-- moduleFolder | +-- component +-- tool Current tool information | +-- type +-- item Current entity (per-cell contexts only) | +-- {propertyName} e.g., context.item.StoryPoints +-- source Parent/source entity (relationship contexts) | +-- {propertyName} e.g., context.source.document.component +-- entity Current entity as a plain object +-- value Current cell's display value
item, source, entity, and value are only available in per-cell contexts (formula, render, formatter, display)
document is available in where clauses and formatter expressions
In $context expressions (domain model constraints), only source and its sub-properties are available