Constraint Types Overview
| Constraint Type | Purpose | When Applied |
|---|---|---|
load | Filters which entities are loaded and displayed in the sheet | At query/load time |
create | Specifies default values for newly created entities | At entity creation time |
pick | Filters which entities appear in selection dropdowns | When opening a picker dialog |
Stage Cascading
Constraint stages cascade upward — more specific stages inherit constraints from less specific ones, combined with AND logic:- Load stage: applies only
loadconstraints - Pick stage: applies
load+pickconstraints (AND) - Create stage: applies
load+pick+createconstraints (AND)
If no
create constraints are defined, the system automatically uses pick constraints for the create stage. This means defining pick constraints also affects item creation unless explicit create constraints override them.Constraint Properties
All three constraint types share the samedocument sub-properties for document-based filtering:
| Name | Type | Default | Description |
|---|---|---|---|
constraints | object | None | Top-level constraint container for an entity type. Contains load, create, and/or pick sub-objects. |
load | object | None | Query constraint defining which entities to load. Filters entities based on document properties or other criteria. |
create | object | None | Default value constraint specifying initial values for newly created entities. |
pick | object | None | Picker constraint filtering which entities appear in selection dropdowns when creating relationships. |
Document Constraint Properties
Each constraint type accepts adocument object with the following properties:
| Name | Type | Default | Description |
|---|---|---|---|
document | object | None | Document-based constraint object specifying document properties for filtering or defaults. |
document.moduleFolder | string | None | Polarion module folder (space) path for document location constraints. |
document.moduleName | string | None | Polarion module (document) name for exact name matching. |
document.type | string | None | Polarion document type for constraints. Filters documents by their type classification. |
document.id | string | None | Polarion document ID in folder/name format (e.g., Requirements/UserNeedSpecification). |
document.title | string | None | Polarion document title for filtering by display name. |
document.component | string | None | Polarion component for constraints. Supports $context references for dynamic scoping. |
Load Constraints
Load constraints filter which entities are visible when loading data into the sheet. They apply query-time filtering based on document properties.Create Constraints
Create constraints restrict where new work items of a specific type can be created, specifying the target document for new entities.SystemRequirement, it will automatically be placed in the document at Requirements/System Requirements with the systemSpecification document type.
Pick Constraints
Pick constraints filter which entities are available in relationship picker dialogs. They scope the options users see when selecting linked items.Comparison Operators
Document constraint properties support five comparison operators. The default is strict equality when a plain value is provided.| Operator | Syntax | Description |
|---|---|---|
| (equals) | type: srs | Exact match (default when a plain value is given) |
contains | moduleName: { contains: Spec } | Value contains the specified text |
in | type: { in: [srs, drs] } | Value matches any item in the list |
startsWith | title: { startsWith: REQ- } | Value starts with the specified prefix |
endsWith | title: { endsWith: -Draft } | Value ends with the specified suffix |
Logical Operators
Multiple properties at the same level are implicitly combined with AND:or inside the document block for OR logic:
Dynamic Context References
Constraints can use$context references for dynamic scoping based on the source entity’s properties:
| Context Reference | Description |
|---|---|
$context.source.document | Reference to the source entity’s document properties. |
$context.source.document.component | Dynamically resolves to the component property of the source entity’s document. |
Navigation Property Constraints
Constraints can also be applied to individual navigation properties within relationships, enabling context-aware filtering on specific expansion paths:userNeeds back-navigation to only include items from documents with the same component as the source entity’s document.
Source-Level Constraints
The sheet configurationsources section supports applyCurrentDocumentTo, which constrains a specific entity type to the current document context:
Constraint Composition
When constraints are defined at multiple levels (entity type + relationship, or combined with sheet-levelapplyCurrentDocumentTo), they are combined using AND logic. All constraints must be satisfied simultaneously.
Initial Values from Constraints
When creating a new work item, Powersheet uses constraint values as initial defaults. For example, if aload constraint specifies document.type: systemRequirementsSpecification, new items are automatically assigned to a document of that type.
Complete YAML Example
Related pages: Domain Model Types | Properties | Storage | Sources
Sources
Sources
KB Articles
- Constraints in Powersheet
- Getting Started: Data Model configuration
- Model Helper
- Core Concepts of Powersheet
prod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/configurations/constraints_model.template.yamlprod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/models/constraints-base.yamlmodel.yamlConstraints.javaprod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/configurations/constraints_currentDocument_downstream.template.yaml