> For the complete documentation index, see [llms.txt](https://docs.quickdev.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quickdev.cloud/applications/application-editor/visual-components/option-lists.md).

# Option lists

A dropdown menu facilitates easy and error-free user input by presenting a list of possible options. QuickDEV provides support for implementing option lists using components like **Select** and **Multiselect**. You can configure an option list either manually or by mapping data from your data sources.

<figure><img src="https://2228196961-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOetSCIB8nFF7hAJCTarW%2Fuploads%2FfzgHFUUd5Cyk856PpHUX%2Foption-lists-overview.png?alt=media&amp;token=1b4dd2b8-bf5e-41de-88bf-abbfcb4e79e1" alt=""><figcaption><p>Overview</p></figcaption></figure>

## Properties

Each option list has four properties.

* **Label**: the displayed text of the option to users
* **Value**: the unique identifier of the option
* **Disabled**: disable the option (the default value is `false`)
* **Hidden**: hide the option (the default value is `false`)

<figure><img src="https://2228196961-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOetSCIB8nFF7hAJCTarW%2Fuploads%2Fa0R0EVyDpd9Jnj8D3Fj9%2Foption-lists-properties.png?alt=media&amp;token=250c4553-bd11-4a9e-9a0d-2d500dcebacb" alt=""><figcaption><p>Properties</p></figcaption></figure>

{% hint style="warning" %}
When more than one option in one list uses the same value, only the first option is valid and thus displayed.
{% endhint %}

## Manual mode

Under **Basic** > **Manual**, select **+ Add** to create a new option. Choose an option to manually configure it. You can use the `···` option to **Duplicate** or **Delete** an option, and rearrange their positions by dragging the `⋮⋮` handle.

<figure><img src="https://2228196961-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOetSCIB8nFF7hAJCTarW%2Fuploads%2FTcslsfUFxDRbmxKnwYsU%2Foption-lissts-manual-mode-overview.png?alt=media&amp;token=8a465b3e-f304-4a7a-9662-4510eedd96b6" alt=""><figcaption><p>Manual mode overview</p></figcaption></figure>

Verify the value of the selected option under **Components** in the data browser. For instance, if **New York** is selected, you'll find the string value `"1"` for **locationSelect**.

<figure><img src="https://2228196961-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOetSCIB8nFF7hAJCTarW%2Fuploads%2FOciThuUOyBUq3aWWXJTS%2Foption-lists-manual-mode-check-value.png?alt=media&amp;token=33a4e876-12c3-4ad4-bba9-67e2b8f8f32e" alt=""><figcaption></figcaption></figure>

Manual mode is recommended for the following scenarios:

* For circumstances in which options must be manually managed and enumerated.
* Used by a single component.
* Data does not come from data sources.

## Mapped mode

When working with option list data supplied from data sources, transformers, or dynamic variables, use Mapped Mode. Enter your data source array in the Data field of Basic > Mapped, using JavaScript (JS). This array will be used to automatically map a set of choices. To obtain university information, use `{{university.data}}`. The output array contains `country`, `web_pages`, `alpha_two_code`, and `name`.

<figure><img src="https://2228196961-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOetSCIB8nFF7hAJCTarW%2Fuploads%2F3xKyEn5fC8BSPouAMQjM%2Foption-lists-mapped-mode-import-data.png?alt=media&amp;token=95f3a675-ad96-4d81-bc35-9fce7f841e3e" alt=""><figcaption></figcaption></figure>

You can access the value of any field of an option through the `item` and its index `i`, starting from `0`. In the following example, the **Label** of each option represents the `name` of the university, while the **Value** corresponds to the `web_page`.&#x20;

<figure><img src="https://2228196961-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOetSCIB8nFF7hAJCTarW%2Fuploads%2FOghfzCv62iYdOXvTp9ZC%2Foption-lists-mapped-mode-overview.png?alt=media&amp;token=eeeb11c8-d8f1-4d2a-87e5-91115a56f865" alt=""><figcaption><p>Mapped mode overview</p></figcaption></figure>

Options containing an opening parenthesis `(` in their names are disabled. The default value is set to the `web_pages` of the first item using `{{university.data[0].web_pages}}`. It's important to note that the default value of an option list should be an element from the **Value** array, not the **Label** array.

<figure><img src="https://2228196961-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOetSCIB8nFF7hAJCTarW%2Fuploads%2F16DUoKRsvFhaMo4JbOT4%2Foption-lists-mapped-mode-check-value.png?alt=media&amp;token=59438054-52a3-44d5-a9f4-56996bd55ce5" alt=""><figcaption></figcaption></figure>
