# Dropdown Widget

**General Setting**

User can change following things in Dropdown widget:

* Name for widget which will be used data referenceFor Example, if widget name is 'Dropdown', then data of widget is referenced as Dropdown.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Dropdown Widget](/files/MTTIGBli1CBJSc3nce2z)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Label Key - Key parameter in key-value pair of input JSON Object which will get added to dropdown.
* Label Value - Value parameter in key-value pair of input JSON Object which will get added to dropdown.
* Fixed List - User can provide fixed list by enabling this option. Fixed list items either will be in \<value,label> or \<value> format.
* Multi Select - Enable this option of multi selection.

![Configure Dropdown Widget](/files/0WtXxB1Y7XOXWXAMYyfa)

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to add option to dropdown list user need to send data in given format on given MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON object will be as below.

```
[{"labelkey":"bike","labelvalue":50}]
[{"labelkey":"scooter","labelvalue":30}]

// 'labelkey' and 'labelvalue' is set as LabelKey and LabelValue in widget form.
```

![](/files/QEGMFak1fy8Zfs3kY8n0)

**Using Action**

Here, to add option to dropdown list, output of the action should contain key-value pair with 'labelKey' and 'labelValue' keys. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Dropdown Widget](/files/G29jVzWW9RX0ftnUL8wE)

#### Event Handling

Dropdown widget does not support any event.

#### Example

If we configure Dropdown Widget as below:

1. Label Key - labelkey
2. Label Value - labelvalue
3. Fixed List - Disabled
4. Multiselect -Disabled

and set source type for widget as MQTT and topic configured is 'data'. And if we publish following JSON array over 'data' topic then Dropdown Widget will look as shown in image.

```
// Data over configured MQTT Topic

[
  {
    "labelkey": "wolf bike",
    "labelvalue": 50
  },
  {
    "labelkey": "Monster bike",
    "labelvalue": 60
  }
]
```

![Dropdown Widget Example](/files/DuVoWcRHcYrgVDSBCs8s)


---

# 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.thingsup.io/widgets/dropdown-widget.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.
