Nextedy POWERSHEET supports document-level query filtering to scope data retrieval to work items within a specific Siemens Polarion ALM LiveDoc.
This reference covers the applyCurrentDocumentTo constraint, document scoping behavior for root and downstream entity types, and how filtering interacts with expansion paths and new entity creation.
Document filtering is a constraint-based mechanism. When the applyCurrentDocumentTo constraint is defined on a data source, Powersheet automatically restricts results to items that belong to the LiveDoc in which the widget is rendered. The filter operates by matching the document’s moduleFolder and moduleName properties against the current LiveDoc context.
The applyCurrentDocumentTo property is defined within the constraints block of a data source configuration. It specifies which entity type should be restricted to only items contained within the current LiveDoc.
Property
Type
Default
Description
constraints.applyCurrentDocumentTo
string
null
Entity type name that should be filtered to only include items belonging to the current document. When the Powersheet widget is rendered inside a LiveDoc, this constraint automatically restricts the named entity type to items within that document.
Use applyCurrentDocumentTo whenever the Powersheet widget is embedded in a LiveDoc and you want the sheet to display only items that belong to that specific document. Without this constraint, the query returns all matching items across the entire project.
Container for all constraint definitions on a data source.
constraints.applyCurrentDocumentTo
string
null
Entity type name to scope to the current document. Must match a valid entity type in the referenced domain model.
constraints.project
string
See application
Project constraint for filtering. Can use dynamic context labels for resolution.
constraints.document
string
See application
Document constraint for filtering. Can use dynamic context labels for resolution.
Constraints on entity types combine with constraints defined on relationships. When both an entity type and a relationship define project or document constraints, they are merged with AND logic before query execution.
When applyCurrentDocumentTo matches the root entity type specified in query.from, the document filter applies directly to the primary query. This is the most common pattern: the sheet displays items of a single type that live in the current document.
When applyCurrentDocumentTo targets a related entity type (not the root query.from entity), the constraint applies to the downstream entity within the expansion path. The root entity type is queried without document restriction.
UserNeed is the root entity type and is not document-filtered
SystemRequirement is the downstream entity type scoped to the current document
The sheet shows all UserNeed items matching the where clause, but only expands to SystemRequirement items that belong to the current LiveDoc
The entity type name specified in applyCurrentDocumentTo must be a valid entity type defined in the referenced domain model. If the entity type is not found, the constraint is silently ignored and no document filtering is applied.
When document filtering is active, the following context information is available for use within query expressions and dynamic value resolution:
Variable
Description
document.moduleFolder
The space (folder) of the current LiveDoc in Polarion (e.g., Requirements)
document.moduleName
The name of the current LiveDoc (e.g., SystemRequirements)
document.id
Full document path combining folder and name (e.g., Requirements/SystemRequirements)
These variables are automatically populated when the Powersheet widget is rendered inside a LiveDoc. They are used internally by the document filter and are also available via $context.document.id expressions in dynamic value configurations.
The exact format of document.id depends on the Polarion space configuration. For documents in the default space (_default), the space prefix may be omitted from the document ID.
When applyCurrentDocumentTo is configured and a user creates a new entity through the sheet, the document constraint is automatically applied to the new item’s initial values. This ensures newly created items are scoped to the current document without manual intervention.
Behavior
Description
Automatic document assignment
New entities of the type specified in applyCurrentDocumentTo receive the current document’s documentId as an initial property value
Scope inheritance
The new entity is created within the same LiveDoc context as the current document, maintaining document-centric data integrity
Constraint enforcement
If applyCurrentDocumentTo targets the root entity type, new items are automatically assigned to the current document
Document constraints defined on entity types propagate to related navigation properties during query expansion. This propagation determines how document scoping applies across the full expansion path.
Source
Propagation Rule
Entity type constraints
Extracted from constraint annotations on the entity type
Navigation property constraints
Merged from both the navigation property annotation and the target entity type annotation
Combined result
AND-combined predicate validated against entity type metadata
When both an entity type and its relationship define document constraints, the system merges them. For many-to-many relationships traversed through association types, the constraint resolver unwraps the association to reach the target entity type and applies the combined constraint there.
Document constraints can also be defined at the entity type level in the domain model YAML, independent of the sheet configuration’s applyCurrentDocumentTo. These constraints apply to all queries against the entity type across every sheet configuration that references the model.
Domain model constraints (load, pick, create) define static document filters based on known folder or document names. In contrast, applyCurrentDocumentTo is dynamic — it uses the current LiveDoc context at runtime. Both mechanisms can coexist; they are combined with AND logic.
See Constraints for the full constraint configuration reference.
Document filtering via applyCurrentDocumentTo works alongside other constraint types defined in the domain model and sheet configuration:
Constraint Type
Interaction with Document Filtering
Project constraints
Applied independently. Both project and document constraints must be satisfied for an item to appear.
Entity type constraints
Merged with AND logic. Domain model constraints on the entity type combine with the document filter.
Relationship constraints
Navigation property constraints on project or document are combined with entity-level constraints when expanding related items.
Security permissions
Checked before any query execution. If the current user lacks read permission (isReadOnly) for the entity type, the query is rejected regardless of document filtering.
When both an entity type and its relationship define document constraints, the constraints are combined. Ensure that the constraint definitions do not conflict or create overly restrictive filters that return empty results.
When document filtering targets a downstream entity type, the constraint must be resolved through the expansion path. The system resolves the path from the root entity type to the filtered entity type by traversing navigation properties defined in the domain model.
For the expansion path UserNeed > systemRequirements > systemRequirement, the constraint resolver:
Starts at the root entity type (UserNeed)
Follows the systemRequirements navigation property (direct direction)
Reaches SystemRequirement and applies the document filter
The resolution supports multi-level dot-notation paths (e.g., systemRequirements.systemRequirement.designRequirements) for deep navigation hierarchies.
When the Powersheet widget is rendered outside a LiveDoc context (for example, in a Wiki page or a standalone widget), the document filter has no effect:
Scenario
Behavior
Widget in LiveDoc
applyCurrentDocumentTo actively filters by current document
Widget in Wiki page
No document context available; constraint is ignored, all matching items returned
Widget with URL parameters
URL parameters (e.g., masterItemId) are applied independently of document filtering
When developing sheet configurations outside a LiveDoc, remember that document filtering is inactive. Validate filtering behavior by embedding the widget in the target LiveDoc.