Skip to main content

Understanding Formula Behavior with Hidden Columns

Formulas execute only when their column is visible in the RISKSHEET grid. This behavior is critical when working with calculated fields like auto-generated titles or RPN values.
Column StateConditionFormula BehaviorValues
Visiblewidth > 0Executes on sheet loadCalculate automatically
Hiddenwidth = 0Does NOT executeRemain stale or empty
When you hide a formula column, calculations stop executing. If you create work items while a calculated title column is hidden, Polarion will receive empty or incorrect title values. Keep formula columns visible during item creation workflows.

Configure a Formula Column

Method 1: Inline Formula Definition

Define the formula directly in risksheet.json:
{
  "formulas": {
    "calcTitle": "function(info) {\n  var severity = info.item['sev'];\n  var desc = info.item['description'];\n  return 'Risk: ' + desc + ' [Sev:' + severity + ']';\n}"
  },
  "columns": [
    {
      "header": "Title",
      "bindings": "title",
      "type": "string",
      "formula": "calcTitle",
      "readOnly": false,
      "width": 200
    }
  ]
}
For complex formulas, define functions in the Risksheet Top Panel: risksheet.json:
{
  "formulas": {
    "calcTitle": "(info) => { return generateTitle(info); }"
  }
}
Top Panel Configuration (Menu > ⚙️ > Edit Top Panel):
<script type="text/javascript">
  function generateTitle(info) {
    var severity = info.item['sev'];
    var occurrence = info.item['occ'];
    var description = info.item['description'];
    var rpn = severity * occurrence;
    return description + ' [RPN:' + rpn + ']';
  }
</script>
Use the Top Panel method when you have multiple formulas or lengthy calculation logic. This keeps risksheet.json readable and makes formula maintenance easier.

Store Calculated Values in Polarion

By default, formula results exist only in the RISKSHEET UI and are not persisted to Polarion. To store calculated values: 1. Create a Custom Field in Polarion Administration
  • Navigate to Administration > Work Items > Custom Fields
  • Select the work item type (e.g., risk)
  • Add a custom field with ID matching your column binding (e.g., rpn)
  • Set the field to Read-only in Administration to prevent manual editing
2. Enable Write Access in Column Configuration
{
  "header": "RPN",
  "bindings": "rpn",
  "type": "int",
  "formula": "commonRpn",
  "readOnly": false,
  "width": 60
}
Setting "readOnly": false allows RISKSHEET to write the calculated value back to Polarion during save operations.

Use Saved Views to Control Column Visibility

You can create multiple saved views to show/hide formula columns for different purposes:
View NameFormula Columns VisibleUse Case
Display ViewYesDaily work, item creation
Export ViewNoPDF/Excel export (formulas already calculated)
Review ViewYesVerification that formulas are correct
Workflow:
Always load a view with formula columns visible at least once per session. This ensures calculations execute before you switch to a view where the columns are hidden.

Synchronize Formula Values with ‘Check Stored Formulas’

Starting in version 24.5.1, RISKSHEET includes a synchronization feature for formula columns: When to Use:
  • After creating work items with hidden formula columns
  • When formula logic changes and you need to recalculate existing items
  • To verify stored values match current formula definitions
How to Use:
  1. Open RISKSHEET with formula columns visible
  2. Navigate to Menu > ** Check Stored Formulas**
  3. RISKSHEET recalculates all formula columns and compares with stored values
  4. Review items where calculated values differ from stored values
  5. Save to synchronize Polarion with calculated values

Common Patterns

Auto-Generated Titles from Multiple Fields

function generateRiskTitle(info) {
  var category = info.item['category'];
  var severity = info.item['sev'];
  var description = info.item['description'];
  
  if (!description) return null;
  
  var prefix = category ? '[' + category + '] ' : '';
  var suffix = severity ? ' (Sev:' + severity + ')' : '';
  
  return prefix + description + suffix;
}

Conditional Formula Execution

function conditionalRpn(info) {
  var status = info.item['status'];
  
  // Only calculate RPN for active risks
  if (status === 'rejected' || status === 'closed') {
    return null;
  }
  
  var sev = info.item['sev'];
  var occ = info.item['occ'];
  var det = info.item['det'];
  
  return sev * occ * det;
}

Verification

You should now see:
  • Formula columns calculating values automatically when visible
  • Calculated values appearing in Polarion custom fields after save (if readOnly: false)
  • The ability to switch between display and export views without losing calculated values
  • Synchronization working correctly via ‘Check Stored Formulas’ feature

See also

KB ArticlesSupport TicketsSource Code
  • PolarionAppConfigManager.java
  • AppConfig.ts
  • ColumnsHelper.ts
  • risksheet.json
  • CellPreviewFormatter.ts