String options for Parameters

When selecting to trigger a new workflow in the CircleCI UI I am met with auto-filled parameters.

My specific pipeline is a String Parameter Type, with a Name and a blank Value.

I’d like to be able to specify specific options to a user for the Value so that they can select from the list which Value they would like to choose.

version: 2.1
commands:
  logging:
    parameters:
      log-level:
        description: 'Log level'
        default: 'warning'
        type: choice
        options:
          - info
          - warning
          - debug
    steps:
      - echo << parameters.log-level >>

In this example, warning is default but when someone chooses to trigger a manual workflow then are presented with a dropdown list of options for the string value.

I think you should be able to use the Enum type for this Reusable config reference - CircleCI

1 Like

Thanks for the quick response.

I see enums do work, but when you open a Trigger Pipeline dialog and see the Parameters fields, you don’t have immediate overview of the options (enums) available to you.

Would have welcomed the Value field to be a dropdown for the user since these values are predetermined.