# Capture user input from dialog message box

Using the [Show Message Box](/deskifier/deskifier-bubble.io-docs/dialog-element/actions.md#show-message-box) action launches a message dialog that allows your application to display important information and prompt the user to choose between one or more options. \
\
These options can be customized.

When a user selects an option, the [Message Box Button Clicked Index](/deskifier/deskifier-bubble.io-docs/dialog-element/states.md#message-box-button-clicked-index) state returns the result of that interaction.&#x20;

Additionally, the [Message Box Checkbox Checked](/deskifier/deskifier-bubble.io-docs/dialog-element/states.md#message-box-checkbox-checked) state will return if the shown checkbox is checked.

<figure><img src="/files/DWHkVcKQY3NdkuE2zMvm" alt=""><figcaption></figcaption></figure>

***

#### How To:

{% hint style="success" %}
View this example in the Bubble editor:\
\
<https://bubble.io/page?id=deskifier-plugin-test&tab=Workflow&name=sandbox&type=page&wf_item=bTPPW>
{% endhint %}

#### Step 1.

To show a message box, we simply just need to call the [Show Message Box](/deskifier/deskifier-bubble.io-docs/dialog-element/actions.md#show-message-box) action.

<figure><img src="/files/z8stRBfziYZNkESqGas2" alt=""><figcaption></figcaption></figure>

We can specify which buttons to display in the message box.&#x20;

<figure><img src="/files/lE1JJVi7tA7mEI4LuKpe" alt=""><figcaption></figcaption></figure>

#### Step 2.

Next, we'll listen for the [Message Box Button Clicked](/deskifier/deskifier-bubble.io-docs/dialog-element/events.md#message-box-button-clicked) event.

<figure><img src="/files/MLrqDo4YsmdpTdGNBV1P" alt=""><figcaption></figcaption></figure>

This will populate our [Message Box Button Clicked Index](/deskifier/deskifier-bubble.io-docs/dialog-element/states.md#message-box-button-clicked-index) state.

{% hint style="info" %}
The button index is **0-based**, which means counting starts at 0 instead of 1.&#x20;
{% endhint %}


---

# 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://deskifier.gitbook.io/deskifier/deskifier-bubble.io-docs/guides-and-examples/capture-user-input-from-dialog-message-box.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.
