Documentation

Select Question

Article

Select Question

When and Why to Use

Use this when you need a single-select multiple-choice question. It's suitable for:

  • Categorical data collection (e.g. gender, preferences, ratings)
  • Recoding responses into other groupings
  • Displaying image-based choices
  • Allowing "Other (please specify)" options

Supports randomization, disabling options, and custom input.

Chat Experience
  • Options appear as buttons or image tiles depending on input.
  • If specify_option is set, an input field appears when selected.
  • Disabled options appear grayed out and cannot be selected.
With imagesWithout imagesList style
Text ImagesPlain TextSelect Question chat Markdown Many Options
Traditional Experience
  • Layout may adjust to grid view or left-right image-plus-label design.
  • Keyboard/remote navigation highlights each choice.
  • Specify input field appears inline or in modal depending on UI.
With imagesWithout imagesMobile optimized List styleMobile Optimized
Markdown ImagesMarkdown Many OptionsMultiselect Question mobile Markdown Many Options483897970 9a60fb2b 8d32 449b 81c6 0e1f7d51beb3
Configuration Options
OptionTypeRequiredDefaultDescription
questionstringyes-The prompt shown to the user
options`List[strMediaItem]`yes-
styleLiteral['button', 'list']nobutton for short lists/questions and list for longer ones.The style to use, either a list or a button.
imageMediaItemno-Image shown above the question
randomizeboolnoFalseShuffle options (except fixed ones)
fixed_optionsList[str]no-Options that remain in place even when randomizing
disabled_optionsList[str]no-Options to gray out/disable
specify_optionstrno-Adds an "Other" option requiring input
specify_textstrno"Please specify"Prompt shown with specify_option
defaultstrnorandom choiceTest data default
recodesDict[str, str]no-Maps response(s) to grouped value(s)
custom_validator`Callable[[str], strNone]`no-
skip_emptyboolnoFalseIf True, skips the question when no options available
image_label_fieldstrno-Field used to label image options from media items
show_image_labelboolnoTrueWhether to show labels with image tiles
image_sizeTuple[int, int]no-Pixel bounding box for rendering image options
tagss.tag()no-Replaces tokens in question and groups results in reports
Example Code

Basic usage:

s.select_question("What is your gender?", options=["Male", "Female", "Non-Binary"])

With disabled and specify:

s.select_question( "What did you enjoy most?", options=["Service", "Price", "Speed"], disabled_options=["Speed"], specify_option="Other", specify_text="Tell us what else you enjoyed" )

With custom validator:

s.select_question( "Which brand do you trust the most?", options=["Brand A", "Brand B", "Brand C"], custom_validator=lambda x: "Are you sure you meant Sleepy Cows?" if x == "Sleepy Cows" else None )
Notes
  • randomize helps reduce bias, especially in brand lists.
  • Use fixed_options to keep options like "None of the above" in place.
  • specify_option is useful for letting users add their own answers.
  • Recoding allows multiple options to be grouped into analysis buckets.