Skip to main content

Use display for Simple Property Selection

The display property specifies which property of a linked entity to show in the cell. For scalar navigation properties (n-to-1 relationships), set it to a property name:
columns:
  hazard:
    title: Hazard
    display: title
This shows the title property of the linked hazard entity instead of the default object representation.

Use display with a JavaScript Function

For custom HTML rendering, set display to a JavaScript arrow function string. The function has access to a context object:
columns:
  riskControls.riskControl:
    title: Risk Control
    display: >
      () => `<a
        target="_blank"
        href="${context.polarionModel.polarionBaseUrl}/polarion/#/project/${context.item.projectId}/workitem?id=${context.item.id}">
        ${context.value.objectId}
      </a>`
Use the YAML > (folded scalar) indicator for multi-line function strings. The JavaScript is evaluated in the browser for each cell.

Context Object Reference

The context object provides access to the current cell’s data:
PropertyDescription
context.valueThe current cell value (the bound property or entity object)
context.itemThe entity object for the current row
context.item.idThe work item ID
context.item.projectIdThe project ID of the work item
context.item.entityTypeThe entity type metadata
context.item.entityType.custom.iconPathPath to the entity type icon
context.polarionModel.polarionBaseUrlBase URL of the Polarion instance
diagram

Use render for Additional Control

The render property works like display for JavaScript functions, but is used when display is already set for property selection. It can also reference a predefined renderer name:
columns:
  status:
    title: Status
    render: myCustomRenderer
Define the renderer as a named snippet using YAML anchors:
snippets:
  displayItemAsIconIDTitleLink: &displayItemAsIconIDTitleLink >
    () =>
      `<img src='${context.item.entityType.custom.iconPath}'><a
        target="_blank"
        href="/powersheet/polarion/#/project/${context.item.projectId}/workitem?id=${context.item.id}">${context.value}</a>`

columns:
  systemRequirements.systemRequirement:
    title: System Requirement
    render: *displayItemAsIconIDTitleLink

Customize Picker Display

The list.display property customizes how items appear in dropdown pickers (not in the cell itself):
columns:
  riskControls.riskControl:
    title: Risk Control
    list:
      search:
        - title
        - id
      display: >
        () => `<img
          src='${context.polarionModel.polarionBaseUrl}/polarion/icons/default/enums/type_purple_feature.png'>
          ${context.value.objectId} ${context.value.title ? '-- ' + context.value.title : ''}`
Use display for selecting a property or rendering the cell content. Use render when display is already used for property selection and you need custom HTML. Use list.display to customize how items appear in picker dropdown lists.

Complete Example

columns:
  outlineNumber:
    title: "#"
    width: 80
    isreadOnly: true
  title:
    title: Title
    width: "*"
    hasFocus: true
  hazard:
    title: Hazard
    display: title
    list:
      search:
        - title
        - id
  riskControls.riskControl:
    title: Risk Control
    display: >
      () => `<a
        target="_blank"
        href="${context.polarionModel.polarionBaseUrl}/polarion/#/project/${context.item.projectId}/workitem?id=${context.item.id}">
        ${context.value.objectId}</a>`

Verify

After saving the sheet configuration, reload the powersheet document. You should now see cells rendering custom HTML content — linked text, icons, or formatted values — according to the JavaScript functions you defined.

See also

KB ArticlesSource Code
  • prod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/packages/common/types/api/document.ts
  • prod-powersheet-src/com.nextedy.powersheet/src/META-INF/hivemodule.xml
  • web.xml
  • prod-powersheet-src/com.nextedy.powersheet/src/com/nextedy/powersheet/enumProvider/SheetConfigEnumProvider.java
  • prod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/packages/common/types/domain/document.ts