Prerequisites
- A Risksheet document with at least one configured column
- Access to the
risksheet.jsonconfiguration file (admin privileges required ---canAdminmust betrue) - Familiarity with calculated columns basics
Understanding Formula and Visibility Interaction
Formula columns in Risksheet execute client-side JavaScript functions to compute derived values such as Risk Priority Numbers (RPN). A critical behavior to understand is that formulas only execute when their column is visible in the current grid view. Hidden columns skip formula execution entirely, which leads to stale or missing values in the underlying Polarion work items. This happens because formulas run during the cell rendering phase. If a column is not rendered (because it is hidden), the formula function is never invoked. The stored Polarion value remains whatever it was the last time the formula executed with the column visible --- or empty if the item was created while the column was hidden.Step 1: Define Formulas in Configuration
Add formula definitions to theformulas section of your risksheet.json. Each formula is a named JavaScript function that receives an info object containing the current row data. The function must return the computed value, or null if the computation cannot be performed (e.g., when input fields are empty).
Basic RPN Formula
The most common formula pattern calculates Risk Priority Numbers by multiplying severity, occurrence, and detection ratings:Title Concatenation Formula
Another common pattern concatenates multiple fields into a title or description:The info Object Reference
The formula function receives a single info parameter with these properties:
| Property | Type | Description |
|---|---|---|
info.item | object | The current row’s data object. Access any column’s value using the column binding as a key (e.g., info.item['sev']). |
info.value | any | The current cell value before formula execution. Useful for formulas that modify rather than replace the existing value. |
Step 2: Assign Formulas to Columns
Reference a named formula in the column definition using theformula property. When a column has a formula set, Risksheet automatically sets readOnly to true for that column, preventing users from manually overriding computed values.
| Property | Type | Default | Description |
|---|---|---|---|
formula | string | None | Name of the formula function defined in the formulas section. When set, the column becomes read-only by default. |
readOnly | boolean | false (auto-set to true for formula columns) | Formula columns are automatically read-only. Setting readOnly: false explicitly allows external reconciliation via Check stored formulas. |
visible | boolean | true | Controls whether the column appears in the grid. Directly affects formula execution --- hidden columns do not calculate. |
level | number | 1 | Hierarchical level at which this column appears. Not relevant to formula behavior but important for FMEA structures. |
type | string | auto-detected | Data type of the column. For RPN formulas, use int or float. |
Step 3: Manage Visibility for Formula Columns
You can control column visibility through thevisible property on individual columns, through saved views, or through user-toggled column visibility. Each approach has different implications for formula execution.
Option A: Permanent Visibility with visible Property
Set visible: true on formula columns that must always compute:
Option B: Saved Views for Context-Specific Visibility
If you need different column layouts for interactive editing versus export, use saved views. Define a full editing view that includes all formula columns, and a separate export view that omits them:Option C: Column Visibility Toggle
Users can hide and show columns interactively through the grid’s column visibility controls. When a user hides a formula column and later shows it again, the formula recalculates on the next render. However, any items created or modified while the column was hidden will retain their stale values until the formula re-executes.Step 4: Reconcile Stored Formula Values
Starting with version 24.5.1, Risksheet provides a Check stored formulas feature that synchronizes formula-computed values with the values stored in Polarion. This feature addresses several scenarios where stored values diverge from formula outputs:- External edits: Changes made to risk items outside of Risksheet (e.g., via Polarion’s native work item editor or a bulk import) are not reflected in formula-dependent fields.
- Hidden column creation: Items created while formula columns were hidden have empty or incorrect computed fields.
- Data migration drift: Polarion upgrades or migrations may truncate or alter stored values (e.g., title fields truncated to 80 characters), causing formula outputs to differ from stored values on subsequent loads.
Running the Reconciliation
- Open the Risksheet document in your browser.
- Ensure all formula columns are visible in the current view. Switch to the editing view if needed.
- Navigate to Menu > Rows > Check stored formulas.
- Risksheet recalculates every formula column for every visible row and compares the computed values against the stored Polarion values.
- Any discrepancies are flagged, and the items are marked as edited.
- Save the document to persist the corrected values back to Polarion.
Step 5: Handle Title Formula Columns Safely
A common FMEA pattern uses a formula to compute the work item title by concatenating fields like failure mode and effect. Title columns require special care because Polarion uses the title for display throughout its interface (work item lists, search results, traceability views).Recommended Approach
- Always keep the title formula column visible during item creation. This ensures new items receive the correct computed title immediately.
- After initial creation, if you must hide the title column for layout reasons, do so only after saving the document with all formulas executed.
- If items were created with the title column hidden, use Check stored formulas (v24.5.1+) to reconcile the title values.
Example Title Formula Configuration
Step 6: Combine Formulas with Conditional Formatting
Formula columns work particularly well withcellDecorators to provide color-coded visual feedback on computed values. For RPN columns, apply threshold-based styling to highlight risk levels:
| CSS Class | RPN Range | Background | Text Color | Risk Level |
|---|---|---|---|---|
rpn1 | 1—150 | Light green (#eaf5e9) | Dark green (#1d5f20) | Low |
rpn2 | 151—350 | Light yellow (#fff3d2) | Dark amber (#735602) | Medium |
rpn3 | > 350 | Light red (#f8eae7) | Dark red (#ab1c00) | High |
Verification
After configuring formula columns and visibility settings, you should now see:- ✅ Formula columns display computed values automatically (e.g., RPN = Severity x Occurrence x Detection)
- ✅ Hiding a formula column and then showing it again causes the formula to recalculate on the next render
- ✅ New items created while formula columns are visible receive correct computed values
- ✅ The Check stored formulas option is available under Menu > Rows (requires version 24.5.1 or later)
- ✅ Saved views correctly toggle formula column visibility without losing stored values
- ✅ Conditional formatting (cell decorators) reflects the computed formula values with appropriate color coding
See Also
- Configure Calculated Columns --- full guide to column formulas and the
formulaproperty - Apply Conditional Formatting --- style cells based on formula output using cell decorators
- Control Column Visibility --- manage which columns appear in the grid
- Create Saved Views --- define view presets for editing and export workflows
- Control Column Visibility in Exports --- export-specific column settings
- Configure Permissions --- understand how field permissions interact with formula saves
Sources
Sources
KB ArticlesSupport TicketsSource Code
PolarionAppConfigManager.javaAppConfig.tsColumnsHelper.tsrisksheet.jsonCellPreviewFormatter.ts