Formula functions in Nextedy RISKSHEET provide a comprehensive toolkit for implementing calculations, data transformations, and conditional logic within your risk management spreadsheet.
Formulas are JavaScript functions defined in the formulas object within your risksheet.json configuration. Each formula receives an info parameter containing the execution context:
Property
Type
Description
info.item
object
Complete work item data with all column bindings as key-value pairs
info.value
any
Current cell value (for display-time formulas)
info.cell
HTMLElement
DOM element of the cell being rendered
info.row
number
Zero-based row index in the grid
info.grid
FlexGrid
Reference to the Wijmo FlexGrid control
Copy
Ask AI
// Example formula structureformulas.myFormula = function(info) { // Access other columns via info.item var occ = info.item['occurrence']; var sev = info.item['severity']; var det = info.item['detection']; // Perform calculation var result = occ * sev * det; // Return null for empty calculations to avoid displaying 0 return result ? result : null;}
The most common FMEA formula multiplies three severity metrics to calculate risk priority:
Copy
Ask AI
// Initial RPN - before mitigationsformulas.commonRpn = function(info) { var value = info.item['occ'] * info.item['det'] * info.item['sev']; return value ? value : null;}// Revised RPN - after mitigations appliedformulas.commonRpnNew = function(info) { var value = info.item['occNew'] * info.item['detNew'] * info.item['sevNew']; return value ? value : null;}
Always return null for empty calculations instead of 0 or empty string. This prevents displaying misleading zero values and maintains clean visual formatting in your grid.
JavaScript automatically coerces types in formula expressions:
Operation
Input Types
Result Type
Example
Arithmetic
number + number
number
5 + 3 = 8
String Concatenation
string + any
string
'Value: ' + 42 = 'Value: 42'
Comparison
any == any
boolean
'5' == 5 = true
Logical
any && any
boolean
0 && true = false
Ensure numeric columns contain valid numbers. Empty strings, undefined, or non-numeric values in arithmetic operations return NaN. Use conditional checks to validate data before calculations.