Prerequisites
Before you begin, make sure you have:- An existing domain model with at least two entity types defined in
domainModelTypes - A Polarion link role created for the relationship (e.g.,
decomposes,verifies) - Access to Administration > Nextedy POWERSHEET > Domain Models
How M:N Relationships Work
Many-to-many relationships in Powersheet use an association entity pattern. Unlike simpler cardinalities (N:1 or 1:N), the M:N relationship introduces an intermediate association layer between the two entity types. This affects how you configure sources and columns:Step 1: Define Both Entity Types
Ensure both sides of the relationship are defined in your domain model underdomainModelTypes. Each entity type must have a polarionType mapping to the corresponding Polarion work item type:
Step 2: Add the Many-to-Many Relationship
In therelationships section of your domain model, add a relationship with cardinality: many-to-many. Define both the direct and back navigation property names:
| Property | Purpose | Example |
|---|---|---|
from | Source entity type (must match a domainModelTypes key) | SystemRequirement |
to | Target entity type (must match a domainModelTypes key) | UserNeed |
cardinality | Relationship multiplicity | many-to-many |
storage | How links are persisted in Polarion | linkedWorkItems |
linkRole | Polarion link role ID (must exist in project config) | decomposes |
direct.name | Forward navigation property (from source to target) | userNeeds |
back.name | Reverse navigation property (from target to source) | systemRequirements |
Step 3: Configure the Source Expansion
In your sheet configuration, set up a two-level expand in thesources section. The first level expands to the association collection, and the second level expands to the actual target entity:
- Level 1 (
systemRequirements) — navigates to the association entity collection - Level 2 (
systemRequirement) — navigates from each association to the actual target entity
Step 4: Configure Columns with Dot-Notation
In thecolumns section of your sheet configuration, use the two-level dot-notation to bind through the association entity to the target:
systemRequirements.systemRequirement— a multi-item reference picker that lets users link and unlink target entities through the associationsystemRequirements.systemRequirement.title— a read-only display of the linked entity’stitleproperty (extend the dot-notation with any target property)
list block on the reference picker column configures the search dialog:
search— which fields to search when filtering candidatescreateNew: true— allows creating new target entities directly from the picker
Step 5: Verify the Configuration
After saving your domain model and sheet configuration:- Open a Polarion LiveDoc or Wiki page that uses this sheet configuration
- Expand a row in the sheet — you should see the linked entities appear as child items through the association
- Click the reference picker cell to open the search dialog and verify you can link and unlink target entities
- Confirm that read-only columns (e.g.,
systemRequirements.systemRequirement.title) display the correct values from linked entities
Cardinality Comparison
For reference, here is how M:N compares to other cardinality types across the three configuration layers:| Cardinality | Model | Source expand | Column binding | UI behavior |
|---|---|---|---|---|
| N:1 | cardinality: many-to-one, direct.name: chapter | - name: chapter | chapter, chapter.title | Single-value reference picker |
| 1:N | Reverse of N:1, back.name: userNeeds | - name: userNeeds | userNeeds | Child rows (new sheet level) |
| M:N | cardinality: many-to-many, back.name: systemRequirements | - name: systemRequirements then - name: systemRequirement | systemRequirements.systemRequirement | Multi-item reference picker |
Powersheet creates and manages the intermediate association entities for M:N relationships. When you unlink two entities, Powersheet removes the association but preserves both linked entities. Deleting an entity removes all its association links as well.
See Also
- Configure a Relationship — general relationship configuration for all cardinality types
- Create Bidirectional Links — setting up
directandbacknavigation properties - Configure Sources — source and expand configuration reference
- Configure Multi-Item Column — detailed multi-item column setup
- Data Model Reference — complete domain model property reference
Sources: Relationship.java, DomainModelV2.java, whole_rtm.template.yaml