Prerequisites
- A data model with a server-rendered property (see Create a Computed Property)
- Basic understanding of Apache Velocity template syntax
1
Access Work Item Properties via $item
The Example
$item variable provides access to the work item model object. Use it to read standard and custom field values:serverRender expression that combines fields:2
Use Conditional Logic
Velocity supports
#if, #elseif, #else, and #end directives for conditional rendering:3
Access Document Context via $module
When a work item belongs to a LiveDoc, the
$module variable provides document-level properties:4
Use the Low-Level Work Item API via $wi
The
$wi variable exposes the Polarion work item API for operations not available on $item:The
$wi variable is only available for work item entities. For other entity types (documents, chapters), use $item or $module instead.5
Use Platform Services
Server-rendered templates have access to several Polarion platform services:Available service variables:
See Access Polarion Services for detailed examples of each service.
6
Handle Errors Gracefully
When a Velocity template fails, Powersheet returns the error marker
#SERVER_RENDER_ERROR in the cell. Protect against common failures with defensive coding:Template Patterns Reference
String concatenation:The available methods on
$item, $wi, and platform services depend on your Polarion version. Test templates with simple expressions before building complex logic.Verify
After configuring a Velocity template expression:- Open the powersheet document in Polarion
- You should now see computed values in the server-rendered column
- Verify that null-safe checks work by testing with work items that have empty fields
- If values show
#SERVER_RENDER_ERROR, consult the Debug Template Errors guide
See Also
- Create a Computed Property — setting up server-rendered properties
- Access Polarion Services — using platform services in templates
- Debug Template Errors — troubleshooting template failures
- Configure a Formatter — styling computed values