> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nextedy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an Entity Type

> Add a new entity type to your Nextedy POWERSHEET data model and map it to a Siemens Polarion ALM work item type so it can be queried, displayed, and linked in your sheets.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

## Prerequisites

* Access to your project's data model YAML file via **Administration > Nextedy Powersheet > Data Models** or through **Menu > Configuration > Edit Data Model** within a powersheet document
* The Polarion work item type you want to map to must already exist in your project configuration

<Steps>
  <Step title="Open the Data Model">
    1. Open your powersheet document
    2. Go to **Menu > Configuration > Edit Data Model**
    3. Locate the `domainModelTypes` section in the YAML editor

    If this is a new data model, the `domainModelTypes` section may be empty or contain only a placeholder. You will add your entity types as keys under this section.
  </Step>

  <Step title="Add the Entity Type Definition">
    Add a new key under `domainModelTypes`. The key becomes the entity type name used throughout Powersheet for relationships, source queries, and column bindings.

    ```yaml theme={null}
    domainModelTypes:
      UserNeed:
        polarionType: user_need
        properties:
          description:
          severity:
    ```

    <Tip title="Naming Convention">
      PascalCase (e.g., `UserNeed`, `SystemRequirement`) is the recommended naming convention for entity type names but is not enforced by the system. Type names must be single words without spaces or special characters. `SystemRequirement` is valid; `System Requirement` is not. Invalid names cause silent errors during model loading.
    </Tip>

    ### Entity Type Fields

    | Field          | Required    | Description                                                                                                                                    |
    | -------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
    | `polarionType` | Recommended | Maps to one or more Polarion work item type IDs. If omitted, the entity type name is used as-is. Accepts a single string or a list of strings. |
    | `properties`   | Yes         | Map of property names to expose. Use `null` values (empty after the colon) for default configuration.                                          |
    | `constraints`  | No          | Optional filtering constraints that scope which Polarion items this entity type includes.                                                      |

    <Frame>
      <img src="https://mintcdn.com/none-17b4493f/3Zik2OH750CE3kB4/powersheet/diagrams/guides/data-model/create-entity-type/diagram-1.svg?fit=max&auto=format&n=3Zik2OH750CE3kB4&q=85&s=d575a9bc6960a55108f31b730f69e0ec" alt="diagram" style={{ width: "520px", maxWidth: "100%" }} width="520" height="180" data-path="powersheet/diagrams/guides/data-model/create-entity-type/diagram-1.svg" />
    </Frame>

    <Warning title="Entity Name vs Polarion Type ID">
      The entity type name (e.g., `UserNeed`) is the Powersheet-internal identifier used in relationships, queries, and column binding paths. The `polarionType` value (e.g., `user_need`) is the Polarion work item type ID used for server queries. These can and often do differ. A common mistake is using the Polarion display name instead of the type ID.
    </Warning>
  </Step>

  <Step title="Define Properties">
    List the Polarion work item fields you want to expose on this entity type. Each key in `properties` must match a built-in field name or custom field name in Polarion.

    ```yaml theme={null}
    SystemRequirement:
      polarionType: sys_req
      properties:
        description:
        severity:
        component:
        type:
        status:
    ```

    Common built-in properties:

    | Property Name | Description                                                 |
    | ------------- | ----------------------------------------------------------- |
    | `title`       | Work item title (automatically included even if not listed) |
    | `description` | Work item description (rich text)                           |
    | `severity`    | Severity enum field                                         |
    | `status`      | Workflow status                                             |
    | `component`   | Component assignment                                        |
    | `type`        | Work item sub-type                                          |

    Properties with a `null` value (empty after the colon) use default configuration. For advanced property configuration including custom field mappings and enum values, see [Add a Custom Property](/powersheet/guides/data-model/add-custom-property).

    <Tip title="Start Minimal">
      Begin with only the properties you need to display in your sheet. You can add more properties later without breaking existing configurations. Starting with a simple single-entity setup makes it easier to diagnose errors during initial setup.
    </Tip>
  </Step>

  <Step title="Add Built-in Types (If Needed)">
    The data model supports the `Document` built-in entity type that does not require a `polarionType` mapping:

    ```yaml theme={null}
    domainModelTypes:
      Document:

      UserNeed:
        polarionType: user_need
        properties:
          description:
    ```

    * **`Document`** -- represents Polarion LiveDoc modules. Automatically includes module-level properties.

    <Info title="Verify in application">
      Other structural types such as headings may need explicit `polarionType` mapping (e.g., `Chapter` with `polarionType: heading`). Check your project's work item type configuration to confirm which types are available.
    </Info>
  </Step>

  <Step title="Map Multiple Polarion Types (Optional)">
    An entity type can map to more than one Polarion work item type by providing a list:

    ```yaml theme={null}
    DesignOutput:
      polarionType:
        - design_output
        - design_verification
      properties:
        description:
        severity:
    ```

    This is useful when a single domain concept spans multiple Polarion types and you want to query them together in one sheet source.
  </Step>

  <Step title="Save and Verify">
    1. Save the data model YAML
    2. Reload the powersheet document
    3. You should now see the new entity type available in source queries and relationship configurations

    To verify the entity type is loaded correctly, use the **Model Helper** widget:

    * Set **model** to your model name
    * Set **startEntity** to your new entity type name
    * Set **depth** to `1`

    The Model Helper displays the entity type with its properties and any configured relationships.

    <Warning title="Model Name Must Match">
      The `sources.model` property in your sheet configuration must match the name of your custom data model, not the default `rtm`. If the model name does not match, Powersheet silently falls back to the default model and your entity types will not appear.
    </Warning>
  </Step>
</Steps>

## Complete Example: RTM Entity Types

A typical requirements traceability matrix uses several entity types connected through relationships:

```yaml theme={null}
domainModelTypes:
  Chapter:
    polarionType: heading

  UserNeed:
    polarionType: user_need
    properties:
      description:
      severity:
      component:

  SystemRequirement:
    polarionType: sys_req
    properties:
      description:
      severity:
      component:

  DesignRequirement:
    polarionType: des_req
    properties:
      description:

relationships:
  - from: UserNeed
    to: Chapter
    cardinality: many-to-one
    storage: linkedWorkItems
    linkRole: parent
    direct:
      name: chapter
    back:
      name: userNeeds

  - from: SystemRequirement
    to: UserNeed
    cardinality: many-to-many
    storage: linkedWorkItems
    linkRole: decomposes
    direct:
      name: userNeeds
    back:
      name: systemRequirements
```

After defining entity types, the `relationships` section connects them using `from`/`to` references, `direct`/`back` navigation property names, and a Polarion `linkRole`. See [Configure a Relationship](/powersheet/guides/data-model/configure-relationship) for the full walkthrough.

<Warning title="Relationship References Are Case-Sensitive">
  Any `relationships` entry that references an entity type by name in `from` or `to` fields must use the exact type name including capitalization. A mismatch causes a "left error" (invalid `from` entity) or "right error" (invalid `to` entity) during model loading.
</Warning>

## Verification Checklist

After saving your data model, confirm the following:

| Check                          | Expected Result                                                           |
| ------------------------------ | ------------------------------------------------------------------------- |
| Model Helper shows entity type | Type appears with listed properties                                       |
| Sheet source query works       | `query: { from: YourType }` returns Polarion work items                   |
| Columns display data           | Properties defined in the entity type can be used as column binding paths |
| No console errors              | Browser console shows no metadata loading errors                          |

You should now see your new entity type available in the Model Helper, ready for use in source queries and sheet column configurations.

## Map Multiple Polarion Types to One Entity

When several Polarion work item types share the same structure, map them all to a single data model entity type using an array:

```yaml theme={null}
domainModelTypes:
  Requirement:
    polarionType:
      - systemRequirement
      - softwareRequirement
      - hardwareRequirement
    properties:
      description:
      severity:
```

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/KGc-UcQNrDeK-NiS/powersheet/images/48001280739/3.gif?s=a09e51ade75f4faf2e233f39e7c4b116" alt="Data model YAML editor showing the DesignRequirement entity type with polarionType set to an array of three Polarion type IDs (hw_des_req, sw_des_req, elec_des_req) plus its properties and constraints" style={{ maxWidth: "720px", width: "100%" }} width="3336" height="788" data-path="powersheet/images/48001280739/3.gif" />
</Frame>

Powersheet queries for the `Requirement` entity type return work items of all three Polarion types. This is useful for consolidated views where you want to display different requirement subtypes in a single sheet level.

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/KGc-UcQNrDeK-NiS/powersheet/images/48001280739/1.png?fit=max&auto=format&n=KGc-UcQNrDeK-NiS&q=85&s=3e41722737802edbcd3715df0bcb7a1b" alt="Design Requirements sheet showing three rows (RTM-301, RTM-302, RTM-303) of different Polarion types - SW, Electronic, and HW Design Requirement - displayed together in a single sheet level with a *Discipline column distinguishing each type" style={{ maxWidth: "720px", width: "100%" }} width="1630" height="732" data-path="powersheet/images/48001280739/1.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/KGc-UcQNrDeK-NiS/powersheet/images/48001280739/2.png?fit=max&auto=format&n=KGc-UcQNrDeK-NiS&q=85&s=9af66c75dbef4c73af8aa4ef33bceb0c" alt="Discipline column dropdown picker open on a Design Requirements row showing the three selectable Polarion subtypes - SW Design Requirement, Electronic Design Requirement, HW Design Requirement - that determine which type is created for the row" style={{ maxWidth: "720px", width: "100%" }} width="1110" height="458" data-path="powersheet/images/48001280739/2.png" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/3Zik2OH750CE3kB4/powersheet/diagrams/guides/data-model/create-entity-type/diagram-2.svg?fit=max&auto=format&n=3Zik2OH750CE3kB4&q=85&s=57206ce3d8745fd058a88e3cc2270648" alt="diagram" style={{ width: "520px", maxWidth: "100%" }} width="520" height="200" data-path="powersheet/diagrams/guides/data-model/create-entity-type/diagram-2.svg" />
</Frame>

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/KGc-UcQNrDeK-NiS/powersheet/images/48001280739/4.gif?s=aa6a497e16e4bcba61715da04a283b17" alt="Multi-Type Component RTM sheet with a new Design Requirements row being created - the user enters a title and picks HW Design Requirement from the *Discipline column to set the underlying Polarion type" style={{ maxWidth: "720px", width: "100%" }} width="2732" height="722" data-path="powersheet/images/48001280739/4.gif" />
</Frame>

<Tip title="When to use multi-type mapping">
  Use array-style `polarionType` when the Polarion types share the same custom fields and you want to view them together. If they have different properties, create separate entity types instead so you can define distinct property sets for each.
</Tip>

## Map Relationship Link Roles

Relationships between entity types use the `linkRole` property to reference a Polarion link role. The link role must already exist in your Polarion project configuration under **Administration > Work Items > Link Roles**.

```yaml theme={null}
relationships:
  - from: UserNeed
    to: Chapter
    cardinality: many-to-one
    storage: linkedWorkItems
    linkRole: parent
    direct:
      name: chapter
    back:
      name: userNeeds

  - from: SystemRequirement
    to: UserNeed
    cardinality: many-to-many
    storage: linkedWorkItems
    linkRole: decomposes
    direct:
      name: userNeeds
    back:
      name: systemRequirements
```

Key properties in each relationship definition:

| Property      | Purpose                                                                           |
| ------------- | --------------------------------------------------------------------------------- |
| `from` / `to` | Source and target entity type names (must match keys in `domainModelTypes`)       |
| `cardinality` | `many-to-one`, `one-to-many`, or `many-to-many`                                   |
| `storage`     | `linkedWorkItems` -- the only supported storage mechanism (Polarion native links) |
| `linkRole`    | Polarion link role ID used to persist the relationship                            |
| `direct.name` | Forward navigation property name (source to target)                               |
| `back.name`   | Reverse navigation property name (target back to source)                          |

<Warning title="Link role must exist in Polarion">
  If the `linkRole` value does not match a link role defined in your Polarion project, Powersheet fails to load related items. Verify available link roles under **Administration > Work Items > Link Roles** before configuring relationships.
</Warning>

## Connect Mappings to Sheet Sources and Columns

After mapping entity types and relationships, wire them into a sheet configuration. The three configuration layers -- data model, sheet sources, and sheet columns -- connect through navigation property names.

**Source configuration** uses the navigation property names from `direct.name` and `back.name` to expand related entities:

```yaml theme={null}
sources:
  - id: user_needs
    query:
      from: UserNeed
    expand:
      - name: chapter
```

**Column configuration** uses the same navigation property names for binding paths:

```yaml theme={null}
columns:
  title:
    title: Title
    hasFocus: true
  chapter:
    title: Chapter
    display: title
    list:
      search:
        - title
  chapter.title:
    title: Chapter Title
    isReadOnly: true
```

The cardinality of the relationship determines how columns behave:

| Cardinality            | Source expand                                                 | Column binding                         | UI behavior                   |
| ---------------------- | ------------------------------------------------------------- | -------------------------------------- | ----------------------------- |
| **N:1** (many-to-one)  | `- name: chapter`                                             | `chapter`, `chapter.title`             | Single-value reference picker |
| **1:N** (one-to-many)  | `- name: userNeeds`                                           | `userNeeds`                            | Child rows (new sheet level)  |
| **M:N** (many-to-many) | `- name: systemRequirements` then `- name: systemRequirement` | `systemRequirements.systemRequirement` | Multi-item reference picker   |

<Tip title="Multi-item columns for second linked type">
  When a parent entity links to two different work item types (e.g., design outputs and design verifications both linked to system requirements), declare the second linked column with `multiItem: true` in the sheet configuration. Without this flag, only the first linked type displays correctly.
</Tip>

## See Also

* [Configure a Relationship](/powersheet/guides/data-model/configure-relationship) -- connect entity types with navigation properties
* [Add a Custom Property](/powersheet/guides/data-model/add-custom-property) -- expose custom fields on entity types
* [Configure Constraints](/powersheet/guides/data-model/configure-constraints) -- add filtering constraints to entity types
* [Set Entity Permissions](/powersheet/guides/data-model/set-permissions) -- control CRUD access on entity types
* [Validate Your Data Model](/powersheet/guides/data-model/validate-model) -- check your model for errors
* [Data Model Reference](/powersheet/reference/data-model/index) -- full data model property reference

<LastReviewed date="2026-07-02" />
