TofuPilotTofuPilot

Multi-Select

Prompt operator with multiple selection from dropdown list.

You can create a multi-select with multiselect:

ui:
  components:
    - key: test_interfaces
      type: multiselect
      label: "Test Interfaces"
      description: "Select all interfaces to test"
      required: true
      options: 
        - label: "USB"
          value: "usb"
        - label: "Ethernet"
          value: "ethernet"

Properties

Display

You can configure how the multi-select appears to the operator.

PropertyTypeRequiredDescription
keystringYesUnique identifier for accessing the value
typestringYesMust be "multiselect"
labelstringNoDisplay label for the multi-select
descriptionstringNoHelper text displayed below the multi-select

Value

You can set default values and bind to measurements or unit properties.

PropertyTypeRequiredDescription
default_valuearrayNoArray of default selected option values
bindstringNoBind to unit property or measurement. See Collect Input for details.

Options

You can define the list of choices available for selection.

PropertyTypeRequiredDescription
optionsarrayYesArray of objects with label and value properties

Each option object has:

PropertyTypeDescription
labelstringText displayed to the operator
valuestringValue submitted when selected

Validation

You can validate selection before the value is submitted.

PropertyTypeRequiredDescription
requiredbooleanNoIf true, operator must select at least one option (shows "Required" badge)

TofuPilot validates operator input before submission, preventing continuation until all constraints are met. For some workflows, this input validation can create workarounds where operators bypass the UI to proceed.

Instead, you can capture the input as a Measurement using Binding and validate it with Validators. TofuPilot will record the actual operator input while enforcing pass/fail criteria.

Examples

Equipment Selection

We'll let operators select required equipment from a large list:

phases:
  - name: Verify Equipment
    ui:
      components:
        - key: required_equipment
          type: multiselect
          label: "Required Equipment"
          description: "Select all equipment needed"
          required: true
          options: 
            - label: "Multimeter"
              value: "multimeter"
            - label: "Oscilloscope"
              value: "oscilloscope"
            - label: "Power Supply"
              value: "power_supply"
            - label: "Signal Generator"
              value: "signal_gen"
            - label: "Load Bank"
              value: "load_bank"
            - label: "Thermal Camera"
              value: "thermal_cam"

Feature Flags

We'll allow operators to enable optional test features:

phases:
  - name: Configure Test Features
    ui:
      components:
        - key: enabled_features
          type: multiselect
          label: "Enable Features"
          required: false
          options: 
            - label: "Advanced Logging"
              value: "logging"
            - label: "Performance Metrics"
              value: "metrics"
            - label: "Video Recording"
              value: "video"
            - label: "Auto-retry on Failure"
              value: "auto_retry"
            - label: "Email Notifications"
              value: "email"

How is this guide?