Skip to main content

Add a Dependent Enum Relationship

  1. Open the Configuration Editor for your RISKSHEET document
  2. Navigate to the Relations section
  3. Click Add Relation to create a new dependency
  4. Configure the relationship properties:
{
  "from": "riskCategory",
  "to": "riskType",
  "mapping": {
    "safety": ["electrical", "mechanical", "thermal"],
    "security": ["authentication", "authorization", "encryption"],
    "performance": ["latency", "throughput", "capacity"]
  }
}
The from field is the parent (controlling field), and to is the child (dependent field). When users select a value in the parent, the child field’s options automatically filter to show only valid combinations.

Define the Mapping Table

The mapping property defines which child values are valid for each parent value:
Parent ValueValid Child Values
safetyelectrical, mechanical, thermal
securityauthentication, authorization, encryption
performancelatency, throughput, capacity
diagram

Behavior with Multi-Select Enums

When the child field is a multi-select enumeration:
  • Changing the parent value filters out any selected child values that are no longer valid
  • If all child values become invalid, the child field is cleared
  • Users can still select multiple values from the filtered list
When you change a parent enum value, RISKSHEET automatically removes invalid child selections. This prevents data inconsistencies but means users may lose multi-select choices when switching parent categories. Consider warning users about this behavior in your workflow documentation.

Bidirectional Relationships

Relationships work in both directions:
  • Forward: Parent → Child (filters child options)
  • Backward: Child → Parent (can auto-populate parent if only one valid option)
If a user selects a child value that requires a specific parent, RISKSHEET automatically sets the parent value when only one valid option exists.

Apply to Bulk Edits

Relationship rules apply during bulk editing:
  1. Select multiple rows using Ctrl+Click or Shift+Click
  2. Edit the parent enum field
  3. All selected rows update their child fields automatically
  4. Undo reverts the entire cascading change across all rows
All cascading updates are tracked as a single operation in the undo stack. Press Ctrl+Z to revert both parent and child changes together.

Matching Binding Prefixes

Dependencies only work between columns with the same binding prefix:
  • master.categorymaster.type
  • task.severitytask.occurrence
  • master.categorytask.type (cross-level not supported)

Verification

You should now see the child dropdown automatically filter its options when you change the parent field. Select different parent values and verify that only the mapped child options appear in the dropdown. For multi-select children, confirm that invalid selections are removed when the parent changes.

See Also

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