Expand Configuration Properties
Each entry in thesources[].expand array accepts the following properties:
Expansion Path Syntax
Expansion paths follow navigation properties defined in the data model. Eachname value must correspond to a relationship property on the parent entity type.
Single-Level Expansion
Load direct related entities of the root entity type:Chapter entity associated with each UserNeed via the many-to-one chapter navigation property.
Multi-Level Expansion
Load deeper levels by nestingexpand arrays inside each other:
expand resolves relative to its parent entity type.
Parallel Branches
A single entity type can expand multiple navigation properties at the same level. List multiple entries in the sameexpand array:
SystemRequirement entities (via the association) and the parent Chapter alongside each UserNeed.
Expand Subquery Filtering
An expand node may carry aquery.where that filters that level by its own attributes, independently of the current document. The where is applied to the level it is attached to; ancestor rows are not affected.
- A
wherecan be attached to any expand node, whether the navigation is scalar (N:1) or a collection (1:N, M:N). - Multiple keys in a single
whereare combined with AND. - A value may be a dynamic expression. When it reads a URL parameter that has no value, the condition is dropped and the level expands unfiltered — see URL Parameters.
where on an expand level also constrains the reference picker for that level: only candidates satisfying the same filter (projected onto the picked entity along the binding path) are offered, so a picked item will not vanish on the next load.
Creating an item at a filtered expand level pre-fills the fields the subquery pins by equality, so the new row satisfies the filter it was created under and does not disappear on the next load. Only equality (
type: Electrical or type: { eq: … }) seeds a default — fuzzy operators (contains, in, ne, or) do not, since they do not pin a single value. An explicit entityFactory default always wins over a filter-derived one, and a subquery scoped to the current document also creates the new item in that document.Cardinality and Expansion Patterns
The relationship cardinality defined in the data model determines the expand syntax and the resulting UI behavior in the sheet.Many-to-One (N:1)
Each child entity references exactly one parent. The navigation property is scalar (singular name). Data model relationship:chapterrenders as a single-value reference picker (scalar navigation property).chapter.titlerenders the referencedChapterentity’s title as a read-only column.
One-to-Many (1:N)
A parent entity has a collection of children. This is the reverse side of a many-to-one relationship. The navigation property is plural (collection name). Source expand:userNeedsexpands into child rows in the sheet, creating a new hierarchical level.- No dot-notation is needed for the expand itself; the expand directly opens the child level.
Many-to-Many (M:N)
Many-to-many relationships use an association entity between the two types. The expansion requires two nested levels: first to the association collection, then through to the target entity.Many-to-many expansion patterns use an implicit association entity generated by the data model. The exact association entity structure depends on how the relationship is defined. Consult a domain expert when configuring complex M:N expansions for the first time.
- The source expand uses two levels:
systemRequirements(association collection) followed bysystemRequirement(target entity). - Column binding uses dot-notation matching the expand path:
systemRequirements.systemRequirement. - The column renders as a multi-item reference picker.
Cardinality Summary
Expand and Column Binding Alignment
Every column with a navigation binding path must have a corresponding expansion in the source configuration. The expand hierarchy must match the column binding path structure.Query Execution
The expand clause is converted to dot-notation strings for query execution. Nested expand arrays are recursively flattened:
This enables loading all related entities in a single server request rather than multiple round-trips. The query engine pre-fetches all expanded entities so the data is available when the sheet renders.
Validation
Expand property paths are validated against the data model metadata at query time. If aname references a navigation property that does not exist on the entity type, the query fails with a validation error.
Document Context
When a source definesconstraints.applyCurrentDocumentTo, the expand clause operates within the document scope. Expanded entities are filtered to those associated with the current document context. See Document Filtering for details.
Performance Considerations
Maximum supported expand depth and performance characteristics depend on the Polarion server configuration and the number of entities at each level.
Complete YAML Example
A full requirements traceability matrix (RTM) configuration showing multi-level and parallel expand paths:- Queries
UserNeedentities scoped to the current document. - Expands the parent
Chapter(N:1) for each user need. - Expands
SystemRequiremententities through the M:N association (systemRequirements.systemRequirement). - Further expands
DesignRequiremententities through another M:N association at the next level. - Binds columns to display titles at each level with appropriate pickers.
Related Pages
- Server-Side Filtering — the concept behind expand subquery
where: filtering each level on the server so only the matching slice loads - EntityQuery — top-level query structure containing the expand clause
- Sources — source configuration including expand, constraints, and query settings
- Binding Syntax — column binding paths that must align with expand paths
- Relationships — data model relationships defining available navigation properties
- Navigation Directions — direct and back navigation direction semantics
- Cardinality — relationship cardinality rules governing expand patterns
- Document Filtering — how document constraints interact with expanded data