Skip to main content

Step 1: Define Enum Options with Descriptions

Add your enumeration definitions to the enums section of risksheet.json. Each option includes an id and name, with an optional description that provides additional context in the dropdown:
{
  "enums": {
    "severity": [
      { "id": "1", "name": "Negligible", "description": "No injury or minor discomfort" },
      { "id": "2", "name": "Minor", "description": "Reversible injury, first aid treatment" },
      { "id": "3", "name": "Serious", "description": "Hospitalization required" },
      { "id": "4", "name": "Critical", "description": "Life-threatening or permanent injury" },
      { "id": "5", "name": "Catastrophic", "description": "Death or multiple fatalities" }
    ]
  }
}
When descriptions are present, the dropdown displays each option name on the primary line with the description shown below it in smaller text. This helps users understand the meaning of each value without needing to consult a separate reference document, which is especially important for domain-specific scales like severity and occurrence ratings defined by ISO 26262 or ISO 14971.
Enum PropertyRequiredPurpose
idYesValue stored when the option is selected (used internally)
nameYesDisplay label shown as the primary text in the dropdown
descriptionNoSecondary text shown below the option name for context
visibleNoControls whether the option appears in the dropdown (default: visible)
For FMEA and HARA workflows, include descriptions that match your organization’s severity and occurrence scale definitions. This ensures that analysts select the correct rating during risk assessment and provides a built-in reference for audit purposes.

Step 2: Configure Rating Enumerations

For risk assessment scales (severity, occurrence, detection), use the ratings section instead of enums. The structure is identical, but ratings are semantically distinct and are used by the risk parameter system:
{
  "ratings": {
    "occurrence": [
      { "id": "1", "name": "Remote", "description": "< 1 in 10,000 operations" },
      { "id": "2", "name": "Low", "description": "1 in 5,000 operations" },
      { "id": "3", "name": "Moderate", "description": "1 in 200 operations" },
      { "id": "4", "name": "High", "description": "1 in 20 operations" },
      { "id": "5", "name": "Very High", "description": "> 1 in 10 operations" }
    ],
    "detection": [
      { "id": "1", "name": "Certain", "description": "Defect will certainly be detected before release" },
      { "id": "2", "name": "High", "description": "High likelihood of detection" },
      { "id": "3", "name": "Moderate", "description": "Moderate likelihood of detection" },
      { "id": "4", "name": "Low", "description": "Low likelihood of detection" },
      { "id": "5", "name": "None", "description": "No detection mechanism exists" }
    ]
  }
}
Both enums and ratings are loaded into the configuration as registries of option arrays. Columns reference them using the type property with the format enum:<id> or rating:<id>.

Step 3: Bind Columns to Enumerations

Reference your enum or rating definitions in column configurations using the type property:
{
  "columns": [
    {
      "id": "sev",
      "binding": "severity",
      "header": "Severity (S)",
      "type": "rating:severity",
      "level": 1
    },
    {
      "id": "occ",
      "binding": "occurrence",
      "header": "Occurrence (O)",
      "type": "rating:occurrence",
      "level": 1
    },
    {
      "id": "hazardCategory",
      "binding": "hazardCategory",
      "header": "Hazard Category",
      "type": "enum:hazardCategory",
      "level": 1
    }
  ]
}
The column type value follows the pattern enum:<enumId> or rating:<enumId>, where <enumId> matches the key in your enums or ratings object. The dropdown editor is automatically activated for these column types. Enum columns display option IDs internally but show user-friendly names in the grid.

Step 4: Set Up Dependent Enum Filtering

Use the relations array in risksheet.json to create cascading dropdowns where one field’s selection filters another field’s available options:
{
  "relations": [
    {
      "parent": "hazardCategory",
      "child": "hazardType",
      "mapping": {
        "electrical": ["shock", "burn", "arc_flash"],
        "mechanical": ["crush", "shear", "impact"],
        "thermal": ["burn", "frostbite"],
        "chemical": ["corrosion", "toxic_exposure"]
      }
    }
  ]
}
The filtering behavior follows these rules:
Parent Field StateChild Dropdown Behavior
Empty (no selection)All child options are shown
Has a value with defined mappingOnly mapped child options are shown
Has a value mapped to empty array []No child options are available
Has a value not in mappingAll child options are shown
diagram
The keys in the mapping object must match the enum option id values of the parent field exactly. If the parent enum uses id: "electrical" but the mapping key is "Electrical" (different case), the filtering will not match and all child options will be shown.

Step 5: Configure Multi-Select Enums

For columns that allow selecting multiple values, use multiEnum:<enumId> as the column type. Multi-select dropdowns display up to 2 selected items in the collapsed cell before showing a count indicator (for example, “+3 more”):
{
  "enums": {
    "impactType": [
      { "id": "safety", "name": "Safety Impact" },
      { "id": "financial", "name": "Financial Impact" },
      { "id": "regulatory", "name": "Regulatory Impact" },
      { "id": "reputational", "name": "Reputational Impact" }
    ]
  },
  "columns": [
    {
      "id": "impactCategories",
      "binding": "impactCategories",
      "header": "Impact Categories",
      "type": "multiEnum:impactType",
      "level": 1
    }
  ]
}
Multi-enum fields are optional by default and can be left empty. Values are stored as an array of enum IDs internally, while the grid displays user-friendly names. Multi-enum columns also support dependent enum filtering through the same relations configuration: when a controlling field changes, the multi-select dropdown automatically filters its available options.
The dropdown has fixed maximum dimensions (400px width, 380px height). For enums with many options or long descriptions, verify that your content displays correctly within these constraints. If descriptions are truncated, consider shortening them.

Step 6: Control Option Visibility

Each enum option supports a visible property that controls whether the option appears in the dropdown. Set visible: false to hide deprecated or retired options while preserving them for historical data:
{
  "enums": {
    "severity": [
      { "id": "1", "name": "Negligible", "visible": true },
      { "id": "2", "name": "Minor", "visible": true },
      { "id": "3", "name": "Serious", "visible": true },
      { "id": "4", "name": "Critical", "visible": true },
      { "id": "5", "name": "Catastrophic", "visible": true },
      { "id": "legacy_high", "name": "High (deprecated)", "visible": false }
    ]
  }
}
Hidden options still display correctly in cells that already contain those values, but they will not appear as selectable choices in the dropdown for new entries.

Verification

You should now see dropdown fields in your Risksheet columns showing the configured enum options with descriptions. Selecting a value in a parent enum field should automatically filter the available options in dependent child fields. Multi-enum columns should display multiple selections as a compact list with a count indicator when more than 2 items are selected.

See Also

KB ArticlesSource Code
  • EnumComboBox.ts
  • MultiEnumEditor.ts
  • RiskSheetContextMenu.ts
  • AppConfigParser.ts