Skip to main content

Step 1: Open the Domain Model

  1. Navigate to Administration > Nextedy POWERSHEET > Domain Models
  2. Select the domain model to edit
  3. Locate the relationships section

Step 2: Define the Relationship with many-to-many Cardinality

Set the cardinality property to many-to-many:
relationships:
  - from: SystemRequirement
    to: VerificationTestCase
    cardinality: many-to-many
    storage: linkedWorkItems
    linkRole: verifies
    direct:
      name: verificationTestCases
    back:
      name: systemRequirements
This allows each SystemRequirement to link to multiple VerificationTestCase items, and each VerificationTestCase to link back to multiple SystemRequirement items. diagram

Step 3: Define Both Entity Types

Ensure both entity types are defined in domainModelTypes:
domainModelTypes:
  SystemRequirement:
    polarionType: systemRequirement
    properties:
      description: ~
      severity: ~
  VerificationTestCase:
    polarionType: verificationTestCase
    properties:
      description: ~

Step 4: Configure Columns with multiItem

In your sheet configuration, use the multiItem: true property on columns that display many-to-many relationships:
columns:
  verificationTestCases.verificationTestCase:
    title: Verification Tests
    multiItem: true
    display: title
    list:
      search:
        - title
        - id
The multiItem flag enables the multi-value picker and displays all linked items in the cell.

Step 5: Configure Sources Expansion

Add the many-to-many relationship to your sources expansion:
sources:
  - query:
      from: SystemRequirement
    expand:
      - name: verificationTestCases

Cardinality Options

CardinalityDescriptionExample
one-to-oneSingle item on both sidesRequirement to its unique specification
many-to-oneMany source items to one targetMultiple tasks to one parent feature
one-to-manyOne source to many targetsOne requirement to multiple sub-requirements
many-to-manyMultiple items on both sidesRequirements to test cases
Powersheet manages intermediate association entities automatically for many-to-many relationships. Unlinking removes the association but preserves both linked entities. Be aware that deleting an entity also removes all its association links.
In the sheet UI, use the linking mode (select a row, then click the link target) to create many-to-many relationships interactively. This works only with many-to-many cardinality relationships.

Complete Example

Here is a domain model with a three-level hierarchy including many-to-many:
domainModelTypes:
  UserNeed:
    polarionType: userNeed
    properties:
      description: ~
  SystemRequirement:
    polarionType: systemRequirement
    properties:
      description: ~
      severity: ~
  VerificationTestCase:
    polarionType: verificationTestCase
    properties:
      description: ~

relationships:
  - from: UserNeed
    to: SystemRequirement
    cardinality: one-to-many
    storage: linkedWorkItems
    linkRole: refines
    direct:
      name: systemRequirements
    back:
      name: userNeeds

  - from: SystemRequirement
    to: VerificationTestCase
    cardinality: many-to-many
    storage: linkedWorkItems
    linkRole: verifies
    direct:
      name: verificationTestCases
    back:
      name: systemRequirements

Verify

After saving the domain model and sheet configuration, open your powersheet document. You should now see:
  • Many-to-many columns display multiple linked items per cell
  • The picker dialog allows selecting and linking multiple target items
  • Unlinking removes the association without deleting the entity

See Also

PowersheetConstants.java, Relationship.java, m-n.spec.ts, RowItemFactory.ts
KB ArticlesSource Code
  • DatabridgeConstants.java
  • DatabridgeMetadata.java
  • MetadataTest.java
  • prod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/packages/sheet/RowItemFactory.ts
  • prod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/packages/sheet/SheetComponent.tsx