# Button from a block or connection trigger

## How to create a button from a connection

Keyboard buttons can be created using connectors. To do this, drag a connector and open the editor:

<div data-with-frame="true"><figure><img src="/files/we3apA7s7tEsa7AZxIIj" alt=""><figcaption></figcaption></figure></div>

To create buttons from connections:

1. Enable this toggle.
2. For each connection, enter the desired button text in its **"Trigger"** field.

{% hint style="warning" %}
Note!

This works only in messengers that support buttons.
{% endhint %}

{% hint style="warning" %}
You can create **ONLY keyboard buttons** using connections.
{% endhint %}

**Then, apply the same configuration to the other connections:**

1. **Open connection settings:** click on the connector to open its settings.
2. **Set the button text:** in the **Trigger** field, enter the text you want to display on the button.
3. **Select match type:** set the comparison type to **"Exact match"**.
4. **Enable button display:** activate the **"Display as button"** option.
5. **Save the configuration:** click **"Save"** to apply the settings.

<div data-with-frame="true"><figure><img src="/files/Lvh8hRsnhQzuGAW04eN3" alt=""><figcaption></figcaption></figure></div>

**Line and position:** buttons created from connections are stacked vertically by default. Use this field to specify a line number and control a button's vertical position in the layout.

<div data-with-frame="true"><figure><img src="/files/QTAybznYaI9OFbm7bKVZ" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="warning" %}
LINE and position numbering STARTS AT 0.\
The first button in the top line will have settings 0 and 0.
{% endhint %}

**Button color:** If needed, you can specify the button color — this works in online chat and Viber.

<div data-with-frame="true"><figure><img src="/files/lruZm53POyvUGdWGbmHu" alt=""><figcaption></figcaption></figure></div>

Result:

<div data-with-frame="true"><figure><img src="/files/ymx2OFEbB73CVDZLlU2F" alt="" width="563"><figcaption></figcaption></figure></div>

## **Button from a block trigger**

Now let’s look at a more advanced method for creating buttons using the **"Advanced button settings"** in the block editor's **Buttons** section.

Previously, we created buttons using connections and triggers on the connectors. An alternative method is to use dedicated trigger blocks, such as the **Start Block** (funnel entry point) or **Trigger Block**.

**Step 1: Create the Block Structure**

1. Create a **Start Block** (the funnel entry point).
2. Create several additional blocks below it. The number of blocks should match the number of buttons you need.

**Example:** In the workflow below, three blocks are created to correspond with three buttons.

<div data-with-frame="true"><figure><img src="/files/Ujyy9eMPB6WvsR1diiqm" alt=""><figcaption></figcaption></figure></div>

**Step 2.** Configure the trigger conditions in the subsequent blocks (in this example, the three Start blocks).

<div data-with-frame="true"><figure><img src="/files/Q6OOPNcv3u1cIuXmbJHQ" alt=""><figcaption></figcaption></figure></div>

**Step 3.** Navigate to the main block (the funnel entry point) and click on the Buttons tab.

<div data-with-frame="true"><figure><img src="/files/oVq1Qqq9GFVPno1kWnqz" alt=""><figcaption></figcaption></figure></div>

**Step 4.** In the **Buttons** section of the block editor, switch to **Advanced settings** and insert the code for your custom button.

`[{"line":0,"index_in_line":0,"text":"Go","type":"reply"},{"line":1,"index_in_line":0,"text":"No","type":"reply"},{"line":2,"index_in_line":0,"text":"Next time","type":"reply"}]`

You will see an identical menu, but without the connections. If configured correctly, clicking a button will trigger the bot to send the message from the corresponding response block.

<div data-with-frame="true"><figure><img src="/files/WRpLtuXxEMMR49lYZ3uQ" alt=""><figcaption></figcaption></figure></div>

**Step 5.** Save the block settings and switch to the bot testing mode.

<div data-with-frame="true"><figure><img src="/files/m7taroJN4ARDrqknE8Pm" alt=""><figcaption></figcaption></figure></div>

When you test the bot, it will render keyboard buttons that are functionally and visually identical to those created with the "Add button" option.

<div data-with-frame="true"><figure><img src="/files/iFjC1rHxzYdS0fa8QzWk" alt="" width="563"><figcaption></figcaption></figure></div>

A button click will deliver the message from its linked Start block (created in Step 1).

<div data-with-frame="true"><figure><img src="/files/iD6zoOTkRL3APzlw5TK1" alt="" width="563"><figcaption></figcaption></figure></div>


---

# 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.mavibot.ai/chatbot/builder/buttons/trigger.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.
