You will need:
- A published bot
- Familiarity with JavaScript if you use method 2
Method 1: Automatic dropdown (Capture Information)
- Add a Capture Information Card to your Workflow. Set the field type to Single Choice or Multiple Choice
- Add your options inside the Card under Choices.
Method 2: Manual dropdown (Execute Code)
To show a dropdown even when you have five or fewer options, or to build the option list in code, send a message withtype: 'dropdown' from an Execute Code Card.
Send the dropdown message
payload.text: Label or instruction shown with the control.payload.options: Each entry is{ label: string, value: string }.label: Text the user sees (for example, a product name).value: Value stored or matched in logic (for example, a SKU). They can match or differ.
Complete the Workflow after the dropdown
After the dropdown is sent, the user will select an option. Here are some typical ways to handle this:- Add a Wait for User Input Card so the Workflow pauses until the user interacts
-
Use an Expression Card (or similar) to evaluate their response by checking
event.payload.value -
Use an Execute Code Card to store their choice. For example:
Remember to create a Workflow variable (for example
varName, type String) and grant access in code as needed (variables in code).
Customize the placeholder text (CSS)
Classes for styling dropdowns are listed under Use custom styles on the appearance settings page. To replace the default Select… style label with your own, add custom CSS under Bot Appearance → Styles in the Studio, for example:content, font-size, and color to match your brand.
You can rely on Capture Information for dropdowns when you have more than five choices, or use
createMessage with type: 'dropdown' in an Execute Code Card whenever you need a dropdown with fewer options or custom label and value pairs.