Formula Sections
Formula Syntax — Complete reference for formula structure, operators, and the parameter context object that provides access to row data Formula Functions — Built-in functions available within formulas including mathematical operations, string manipulation, date handling, and RISKSHEET-specific utilities Formula Examples — Working examples demonstrating common calculation patterns, conditional logic, and integration with FMEA/HARA workflowsQuick Start
Formulas are JavaScript functions defined in theformulas section of risksheet.json and applied to columns via the formula property:
getRiskPriority() in the Top Panel <script> section.
Key Concepts
Formula Execution — Formulas run automatically when the risksheet loads and whenever dependent cell values change. Results are displayed immediately in the grid. Read-Only by Default — Formula columns are automatically read-only since their values are computed, not user-entered. You can override this to store calculated results in Polarion custom fields. Context Parameter — All formulas receive aninfo object providing:
info.item— Object containing all row data (access via column binding:info.item['columnId'])info.cell— HTML DOM element for the cell (used with cell decorators)info.row— Row index in the gridinfo.col— Column index in the grid
null for empty cells.
Common Patterns
Risk Priority Number (RPN)Integration with RISKSHEET
Formulas support all standard Nextedy RISKSHEET workflows:- FMEA Workflows — Calculate RPN, priority scores, and mitigation effectiveness
- HARA Workflows — Compute risk levels based on severity and probability parameters
- Risk Matrices — Display calculated risk levels in risk matrix visualizations
- Export — Include formula results in Excel and PDF exports
- Comparison — Track formula-driven changes when comparing document revisions
Formula Storage
Formulas are stored in two configurations:| Configuration | Location | Best For |
|---|---|---|
| Inline | risksheet.json formulas object | Simple calculations, single-line logic |
| Top Panel | Wiki page <script> section | Complex logic, multiple formulas, code organization |
Storing Calculated Values
By default, formula results are computed dynamically and not persisted to Polarion. To save calculated values:- Create a custom field in Polarion Administration
- Set the column binding to match the custom field ID
- Set
readOnly: falsein the column configuration - Make the field read-only in Polarion to prevent manual editing
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| Formula returns undefined | Reference column ID doesn’t match binding | Use correct column ID in info.item['columnId'] |
| Formula returns 0 instead of null | Missing null check | Return null explicitly for empty cells |
| Formula doesn’t recalculate | Dependency cell not changed | Ensure formula references actual cell bindings |
| Export missing formula values | Column not included in export settings | Check export visibility configuration |
Sources
Sources
KB ArticlesSource Code
AppConfig.tsAppConfigHelper.tsrisksheet.jsonCellPreviewFormatter.tsPolarionAppConfigManager.java