Skip to main content
JavaScript display functions are an advanced customization technique. Before using them, ensure you are comfortable with adding columns and configuring formatters.

Understand render vs display vs renderers

Powersheet offers three properties for controlling cell output. Each serves a distinct purpose:
Neither render nor display modify the underlying data. If you need a calculated value that is saved back to the data source, use the formula property instead. See Configure Dynamic Expressions for details on formula.
diagram

Use display for property selection

The simplest use of display is selecting which property of a linked entity to show. For scalar navigation properties (n-to-1 relationships), set it to a property name string:
This shows the title property of the linked Hazard entity instead of the default identifier.

Use display with a JavaScript function

For dynamic cell content, set display to a JavaScript arrow function string. The function receives a context object and should return an HTML string:
Use the YAML > (folded scalar) indicator for multi-line function strings:
The JavaScript is evaluated in the browser for each cell at render time.

Use render for custom HTML

The render property provides custom HTML rendering for a column. It accepts either an inline JavaScript expression or a reference to a named renderer: Inline expression:
Named renderer reference:
Use display when you need to select which property of a navigation property to show, or to format it with JavaScript. Use render when you need custom HTML rendering for any column type. When both are set on the same column, render takes precedence for visual output.

Define reusable renderers

The renderers section at the root level of the sheet configuration defines named renderer functions. Each renderer is a JavaScript arrow function string with access to the context object:
Reference a named renderer from any column’s render property:
When the same display logic applies to multiple columns, define it once in renderers and reference it by name. This avoids duplicating JavaScript across column definitions and makes maintenance easier.

Customize picker display

The list.display property customizes how items appear in dropdown pickers, not in the cell itself:

Context object reference

Dynamic expressions receive a context object. The available properties depend on the evaluation location:
If a column uses a custom render or JavaScript display function, the automatic external link (the hasUrl feature) will not be displayed for that column. Plan your link rendering within the JavaScript function if you need clickable URLs.

Complete YAML example

Verify

After saving the sheet configuration, reload the powersheet document. You should now see cells rendering custom HTML content — bold text, formatted identifiers, or concatenated values — according to the JavaScript functions you defined. Columns using render or display functions will show the transformed output instead of raw property values.

See also

Last modified on July 10, 2026