TofuPilotTofuPilot

Select

Prompt operator with single selection from dropdown list.

You can create a select with select:

ui:
  components:
    - key: voltage
      type: select
      label: "Power Supply Voltage"
      description: "Select the test voltage"
      required: true
      options: 
        - label: "3.3V"
          value: "3.3"
        - label: "5.0V"
          value: "5.0"

Properties

Display

You can configure how the select appears to the operator.

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

Value

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

PropertyTypeRequiredDescription
default_valuestringNoDefault selected option value
bindstringNoBind to unit property or measurement. See Collect Input for details.

Options

You can define the list of choices available in the select.

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 an 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

Product Variant Selection

We'll let the operator select from multiple product variants:

phases:
  - name: Select Variant
    ui:
      components:
        - key: product_variant
          type: select
          label: "Product Variant"
          required: true
          options: 
            - label: "Standard - 8GB RAM"
              value: "std_8gb"
            - label: "Standard - 16GB RAM"
              value: "std_16gb"
            - label: "Pro - 16GB RAM"
              value: "pro_16gb"
            - label: "Pro - 32GB RAM"
              value: "pro_32gb"
            - label: "Enterprise - 64GB RAM"
              value: "ent_64gb"

Operator Selection

We'll track which operator is performing the test:

phases:
  - name: Operator Login
    ui:
      components:
        - key: operator_name
          type: select
          label: "Operator"
          description: "Select your name"
          required: true
          options: 
            - label: "Alice Johnson"
              value: "alice"
            - label: "Bob Smith"
              value: "bob"
            - label: "Carol Davis"
              value: "carol"
            - label: "David Lee"
              value: "david"

How is this guide?