Skip to main content
See also: Data Model Types | Properties | Relationships | Cardinality

Constraint Stages Overview

diagram
Powersheet supports three constraint stages, each applied at a different point in the entity lifecycle:

Stage Cascading

Constraint stages cascade upward — more specific stages inherit all constraints from less specific ones, combined with AND logic:
  • Load stage: applies only load constraints
  • Pick stage: applies load + pick constraints (AND)
  • Create stage: applies load + pick + create constraints (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.
Because load constraints propagate to all subsequent stages, a load constraint that restricts entities to a specific document will also restrict picker results and creation scope. You only need to define more specific constraints when pick or create require additional filtering beyond what load already provides.

Constraint Properties Reference

Top-Level Structure

Document Constraint Properties

Each constraint stage accepts a document object for document-based filtering. These properties scope entities to specific Polarion LiveDoc documents. All standard document metadata fields are constrainable.
All document metadata fields — moduleFolder, moduleName, type, id, title, and component — can be used in constraint expressions. Combine them within a single document block to express precise scoping rules (for example, constraining by space and document type together).

Field-Level Constraint Properties

In addition to document constraints, each stage can constrain on work item field values:

Comparison Operators

Constraint values support five comparison operators for flexible matching:
When a constraint value is a plain string (not an object), it is treated as an equals comparison. Use the object syntax only when you need a different operator.

Logical Operators

AND Logic (Between Constraints)

Multiple constraints within the same stage are combined with AND logic. All conditions must be true for an entity to pass the constraint:

OR Logic (Within Document Block)

Inside the document block, OR logic is supported. An entity passes the constraint if it matches any of the document conditions:
Field-level constraints use AND logic between each other, while the in operator provides OR semantics within a single field. This combination covers most practical filtering scenarios.

Dynamic Context Constraints

Constraints can reference the current runtime context using special context expressions. This enables constraints that are resolved dynamically based on the active sheet session.
This configuration ensures that only work items from the currently viewed document are loaded into the sheet and shown in pickers.
The full list of available context variables may extend beyond $currentDocument. Consult the application release notes for the latest supported context expressions.
For more on context expressions in queries, see Context Expressions Reference.

Constraint Composition

Constraints can be defined at multiple stages simultaneously on the same entity type. When combined, stages cascade as described above.

Composition Example

Effective constraints at each stage:
Constraint composition can produce empty results if constraints conflict. For example, a load constraint limiting entities to status: approved combined with a pick constraint for status: draft would produce no picker results because both conditions apply simultaneously (AND logic). Review your cascading chain to avoid contradictions.

Complete YAML Examples

Load-Only Constraint

Restrict an entity type to only show work items from a specific document:
Effect: Only UserNeed items in the “Requirements” document are loaded into the sheet. Pickers and creation inherit this constraint.

Pick-Only Constraint

Allow all entities to load but restrict picker options:
Effect: All SystemRequirement items load normally. Picker dialogs only show items with status approved or reviewed. Since no create constraints are defined, the pick constraints apply as a fallback during creation as well.

Create-Only Constraint

Set default values when creating new entities without affecting loading or picking:
Effect: All hazards load normally and all appear in pickers. Newly created hazards default to severity: low and status: draft.

Current-Document Scoping

Dynamically scope all stages to the currently open document:
Effect: Loading, picking, and creation are all scoped to the document currently open in Polarion. This is the most common pattern for document-centric sheets.

Multi-Stage Composition

A complete example combining all three stages with different scoping:
Effect:
  • UserNeed items load from the current document, pickers show only approved/reviewed/draft items from that document, and new items default to severity: medium
  • SystemRequirement items load from the current document, pickers show only high/critical severity items from that document
  • The relationships section connects the two entity types — picker constraints on UserNeed affect which items appear when linking a SystemRequirement to user needs

Constraints and Relationships

Constraints interact with Relationships through picker behavior. When a sheet column binds to a navigation property (e.g., userNeeds or chapter), the picker dialog for that column uses the pick constraints defined on the target entity type. For details on how cardinality affects column bindings, see Cardinality. For details on column binding syntax, see Binding Syntax.
If a picker shows too many or too few items when linking entities, check the pick constraints on the target entity type. Remember that load constraints cascade into pick, so an overly restrictive load constraint will also limit picker results.

Sheet-Level Constraints

In addition to data model constraints, constraints can also be applied at the sheet configuration level through source queries. Source-level constraints use the query and expand syntax rather than the constraints YAML key.
Source-level filtering and data model constraints work together:
  • Data model constraints (this page) define permanent scoping rules for an entity type across all sheets
  • Source query constraints restrict which entities appear in a specific sheet configuration
For source query syntax, see Sources. For query filtering options, see EntityQuery and Document Filtering.

Quick Reference

Constraint Stage Summary

Operator Summary

Cascading Rules


Last modified on July 10, 2026