Skip to main content

Source Properties

PropertyTypeDefaultDescription
sourcesarray[]Top-level array of data source definitions. The first source (sources[0]) is the primary data source for the sheet.
sources[].idstringNoneUnique identifier for this data source within the configuration
sources[].titlestringNoneHuman-readable label for this data source, displayed in the Powersheet UI
sources[].modelstringNoneReference to the domain model that defines entity types and relationships. Can be a static name or a dynamic expression using $context.parameters.model.
sources[].queryobjectNoneQuery definition specifying which entities to load
sources[].constraintsobjectNoneOptional constraints applied to the source query
sources[].expandarray[]Defines expansion paths for loading related entities through domain model relationships

Query Properties

PropertyTypeDefaultDescription
sources[].query.fromstringNoneRoot entity type to query. Must be a valid entity type defined in the referenced domain model.
sources[].query.wherestringNoneFilter predicate for the query. Supports Polarion Lucene query syntax. Template placeholder <WHERE> is replaced at runtime.
sources[].query.takestring/numberNoneMaximum number of records to return. Template placeholder <TAKE> is replaced at runtime.
The where and take properties support runtime placeholder replacement. Use <WHERE> and <TAKE> as template placeholders that are resolved at document load time from URL parameters or document context.

Constraint Properties

PropertyTypeDefaultDescription
sources[].constraints.applyCurrentDocumentTostringNoneFilters the specified entity type to only include items from the same Polarion document as the current context. Can target the root entity or a downstream related entity type.

Expand Properties

PropertyTypeDefaultDescription
sources[].expandarray[]Array of expansion definitions. Each entry loads related entities through a domain model relationship.
sources[].expand[].namestringNoneNavigation property name to expand, as defined in the domain model relationships
sources[].expand[].titlestringNoneDisplay title for the expanded entity group in the sheet header
sources[].expand[].expandarrayNoneNested expansion for loading multi-level relationships. Same structure as the parent expand.

Source Data Flow

diagram

Basic Source

sources:
  - id: main
    title: User Needs
    model: rtm
    query:
      from: UserNeed
      where: <WHERE>
    expand:
      - name: systemRequirements
        title: System Requirements

Multi-Level Expansion

Nested expand definitions load entities through multi-level domain model relationships:
sources:
  - id: main
    title: Requirements Traceability
    model: rtm
    query:
      from: UserNeed
      where: <WHERE>
      take: <TAKE>
    expand:
      - name: systemRequirements
        title: System Requirements
        expand:
          - name: designRequirements
            title: Design Requirements
            expand:
              - name: hazards
                title: Hazards
                expand:
                  - name: riskControls
                    title: Risk Controls

Dynamic Model Reference

The model property can use a dynamic expression to resolve the model name from document parameters at runtime:
sources:
  - id: main
    model: "$context.parameters.model"
    query:
      from: UserNeed
      where: <WHERE>

Document Constraints

The applyCurrentDocumentTo constraint scopes entities to the current Polarion document:
sources:
  - id: main
    model: rtm
    query:
      from: UserNeed
      where: <WHERE>
    constraints:
      applyCurrentDocumentTo: SystemRequirement
    expand:
      - name: systemRequirements
        title: System Requirements
The applyCurrentDocumentTo value must be a valid entity type name from the domain model. When targeting a downstream entity (not the root from entity), only the downstream entities within the current document are loaded.

Complete YAML Example

sources:
  - id: main
    title: RTM Traceability
    model: rtm
    query:
      from: UserNeed
      where: <WHERE>
      take: <TAKE>
    constraints:
      applyCurrentDocumentTo: UserNeed
    expand:
      - name: systemRequirements
        title: System Requirements
        expand:
          - name: designRequirements
            title: Design Requirements
          - name: verificationTestCases
            title: Verification Test Cases
      - name: validationTestCases
        title: Validation Test Cases

columns:
  outlineNumber:
    title: "#"
    width: 80
  title:
    title: User Need
    width: 200
    hasFocus: true
  systemRequirements.systemRequirement.title:
    title: System Requirement
    width: 180
  systemRequirements.systemRequirement.designRequirements.designRequirement.title:
    title: Design Requirement
    width: 180

Source references: constraints_composing.template.yaml, whole_rtm.template.yaml, constraints_currentDocument_downstream.template.yaml, QueryManager.tsx
KB ArticlesSource Code
  • prod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/configurations/constraints_composing.template.yaml
  • prod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/configurations/whole_rtm.template.yaml
  • prod-powersheet-src/com.nextedy.powersheet.client/src/modules/Powersheet/Powersheet.tsx
  • prod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/configurations/constraints_currentDocument_downstream.template.yaml
  • prod-powersheet-src/com.nextedy.powersheet.client/src/modules/QueryManager/QueryManager.tsx