> For the complete documentation index, see [llms.txt](https://documentation.hak5.org/wifi-pineapple-pager/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.hak5.org/wifi-pineapple-pager/list_picker.md).

# LIST\_PICKER

`LIST_PICKER` Prompt the user to interactively select from a list

### When to use it <a href="#when-to-use-it" id="when-to-use-it"></a>

Use `LIST_PICKER` to prompt the user to perform different actions inside your payload, such as installing, configuring, or running. You can also use `LIST_PICKER` to present multiple options as results from a scan or other interactive choices.

`LIST_PICKER` was added to the Pineapple Pager in firmware version `1.0.8`. It will not be available on earlier firmware releases.

#### Syntax <a href="#syntax" id="syntax"></a>

```none
LIST_PICKER [title] [option] [default]
```

**title&#x20;*****required***

Prompt / dialog title. Titles should be kept short enough to fit on the device display.

**option&#x20;*****required***

One or more options. Each option is shown as a separate list item. Options should always be protected by quotes.

**default&#x20;*****required***

Default / preselected option.

{% hint style="warning" %}
A default option must always be provided!
{% endhint %}

<figure><img src="/files/3Xze6UX7LGnVB3pWTxPc" alt="A list picker dialog"><figcaption><p>A list picker dialog</p></figcaption></figure>

### Results <a href="#results" id="results"></a>

`LIST_PICKER` will wait until the user has made a selection, pausing the payload.

`LIST_PICKER` exits with a return code of `0` if the user continues, and non-zero if the user cancels.

`LIST_PICKER` returns the selected option text as the output

### Examples <a href="#examples" id="examples"></a>

```bash
__option=$(LIST_PICKER "FooPayload" "Install" "Configure" "Run" "Exit" "Run") || exit 0
case "${__option}" in
  "Install")
     # do install stuff
     ;;
  "Configure")
     # do configure stuff
     ;;
  "Run")
     # do run stuff
     ;;
  *)
     exit 0
esac
```

{% hint style="info" %}
Remember to enclose the prompt text in quotes if it contains spaces!
{% endhint %}
