# Drop Down

A drop-down control renders to a standard HTML \<select /> tag containing \<option /> tags. You can populate the drop-down from a data source or define a static list.

***

{% embed url="<https://www.youtube.com/embed/V5kqmTXXzLY?autoplay=1&rel=0&vq=1080>" %}
*Add a Drop Down*
{% endembed %}

***

### Properties

1. **Options**

   Specify a list of options to display in the control. It can be generated from a static list or from data. When populating the Options from a [*Connector*](/connectors.md) or file, use the Field Mapping Editor found in the Property Grid (seen circled in red below) to assign the *Text* and the *Value* of the items. ![](/files/yQXPINXI1PRvsFXxo1LY)
2. **Hint**

   Some placeholder text that will show when the drop down is empty. This value is not saved if no other value is entered.
3. **Read-Only**

   Set to True if you want the control to display as read-only (value can't be changed) on the page.
4. **Selected Value**

   This value will be shown in the drop down when the field loads.
5. **Validations**

   Some validations that can be applied to the drop-down.
6. **Visible**

   Set to False if you don't want this control to render on the page and be visible to the user.

***

### Assigning data to a DropDown

Example:

To display a DropDown list containing option values retrieved by a SQL query:

1. Use an appropriate [Event](/features/events.md), e.g. *Load* (page) or *Click* (button) to which a [*SetValue* ](/actions/set-value.md)action can be added.
2. Add a [SetValue](/actions/set-value.md) action that populates the DropDown *options* with each returned value.

Data:

DropDowns expect a `List` of objects containing a `text` and a `value` property

```json
[
    {"text":"Monday","value":"1"},
    {"text":"Tuesday","value":"2"},
    {"text":"Wednesday","value":"3"},
    {"text":"Thursday","value":"4"},
    {"text":"Friday","value":"5"}
]
```

The [Field Mapping ](/features/mappings.md)option in the [SetValue](/actions/set-value.md) action allows for the mapping of object properties other than text & value to these properties

***

### Retrieving data from a DropDown

Properties that can contain data:

* Options (Value)

Use an [action](/actions.md) to capture the values from the control. Go here for more details on how to collect data from controls.

***

### Events

1. **Change**

   An event that triggers when another option in the dropdown is selected.

   Event Input Parameters:

   1. PreviousOption\
      The *Text* and *Value* of the option that was selected before selecting the option.
   2. SelectedOption\
      The *Text* and *Value* of the newly selected option.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stadium.software/controls/drop-down.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
