Skip to main content

Prerequisites

  • Risksheet version 25.3.1 or later (single-value enums) or 25.4.0 (multi-value enums)
  • Enum columns already defined in your risksheet.json
  • Administrator access to edit the configuration

Step 1: Define the Enum Options

In your risksheet.json, define both the parent and child enumerations in the enums section:
{
  "enums": {
    "riskCategory": [
      { "id": "hardware", "name": "Hardware" },
      { "id": "software", "name": "Software" },
      { "id": "mechanical", "name": "Mechanical" }
    ],
    "riskType": [
      { "id": "esd", "name": "ESD Failure" },
      { "id": "shortCircuit", "name": "Short Circuit" },
      { "id": "memoryLeak", "name": "Memory Leak" },
      { "id": "deadlock", "name": "Deadlock" },
      { "id": "fatigue", "name": "Metal Fatigue" },
      { "id": "wear", "name": "Wear" }
    ]
  }
}

Step 2: Define Columns for Both Enums

Add the parent and child columns to your columns array:
{
  "columns": [
    {
      "id": "riskCategory",
      "header": "Risk Category",
      "binding": "riskCategory",
      "type": "enum:riskCategory"
    },
    {
      "id": "riskType",
      "header": "Risk Type",
      "binding": "riskType",
      "type": "enum:riskType"
    }
  ]
}

Step 3: Configure the Relation Mapping

Add a relations array to your configuration. Each relation defines the from (parent) column, the to (child) column, and a mapping that specifies which child values are valid for each parent value:
{
  "relations": [
    {
      "from": "riskCategory",
      "to": "riskType",
      "mapping": {
        "hardware": ["esd", "shortCircuit"],
        "software": ["memoryLeak", "deadlock"],
        "mechanical": ["fatigue", "wear"]
      }
    }
  ]
}
With this configuration, selecting “Hardware” in the Risk Category column filters the Risk Type dropdown to show only “ESD Failure” and “Short Circuit”.

How the Cascading Behavior Works

  • When the parent field value changes, Risksheet automatically updates the child dropdown options
  • If the parent field is empty or has no mapping entry, all child options are shown
  • If the parent value maps to an empty array, no child options are shown
  • Cascading changes are tracked in the undo stack — you can revert the entire chain with a single undo
Relationship mappings only work between columns with the same binding prefix. Cross-level relationships (e.g., master field to task field) are not supported and will be ignored.

Step 4: Configure Multi-Enum Dependencies (Optional)

For multi-select enum columns, use the multiEnum: type prefix instead of enum:. The relation mapping works the same way:
{
  "columns": [
    {
      "id": "riskType",
      "header": "Risk Type",
      "binding": "riskType",
      "type": "multiEnum:riskType"
    }
  ]
}
When a parent value is deselected, any child multi-enum values that depended on that parent are automatically removed. This prevents invalid data combinations.
Risksheet supports both forward (parent to child) and backward (child to parent) relationship updates. If a child value requires a specific parent value and only one valid parent exists, the parent is auto-populated.

Step 5: Bulk Editing with Dependent Enums

When you select multiple rows and edit a parent enum field, all dependent child fields across all selected rows update automatically according to the configured relationship rules.

Verification

You should now see that when you select a value in the parent column, the child column dropdown filters to show only the mapped options. Changing the parent value should automatically clear or update the child value if the current selection is no longer valid.

See Also


Support TicketsSource Code
  • MultiEnumEditor.ts
  • EnumComboBox.ts
  • AppConfig.ts
  • RelationActionController.ts
  • CellEditorFormatter.ts