# Ask Form

> **Who can use this Card?**
>
> * Gallabox Users having permission to either build and deploy bots or manage bots.
> * Available on Scale and Growth Plans.

## **Understanding "Ask Form"**

The Ask Form feature enables to send the interactive forms, allowing users to input information seamlessly. This feature includes customization options for the header, questions, footer, and the ability to store responses in variables.

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2F42RnMByJi7SzSmveVHCi%2FAsk%20Form.gif?alt=media&#x26;token=4b6446ad-e0c9-4eac-a56a-d44971271365" alt=""><figcaption></figcaption></figure>

## **Ask Form Essentials:**

Before using Ask Form in your chatbot, here are some things you need to know:

### **Header Text**

This field allows you to set an optional header text for the form, providing context or a title. For example: "Survey Form" or "Booking Form".&#x20;

### **Question Text**

The question text is where you define the main query or prompt for the user. For example: "What is your feedback?"

### **Footer**

Optionally, you can include a footer text. It can be used for additional information or a closing message. In the example: "Thank you for your response!"

### **Button Name**

This involves specifying the name for the form submission button. For example: "Submit."

### **WhatsApp Flow**

Here, you select the WhatsApp flow you want to associate with the form. It is a predefined flow for handling user responses.

To create WhatsApp Flow, [click here](https://docs.gallabox.com/whatsapp-flows/create-whatsapp-forms).&#x20;

### **Flow Action**

The flow action defines what happens after the user interacts with the form. In the example: "Navigate" suggests moving to another screen or action within the WhatsApp flow.

### **Screen Name**

Paste the Screen Id from the JSON.

### **Response Storage Variable**

This optional setting allows you to store user responses in a variable for later use or processing.&#x20;

Variable should follow specific rules, such as starting with an alphabet and only allowing underscores as special characters. In the example: "user feedback."

### **Validation Settings**

These rules are important to make sure users provide the right info.&#x20;

Let's explore the key components of the validation settings for the "**Ask Form**" question type:

1. **Attempt:**

Define the number of attempts a user has to provide a valid response. This feature helps manage user expectations and encourages accurate inputs.

2. **Validation Error Message:**

An optional setting where you can enter a specific error message to guide users in case of invalid input.

3. **Action on Invalid Response:**

Here is how to make sure the conversation stays smooth even if there's a mistake in the answer. Here's how you can handle it:

* **Drop from the bot**: If there's an error, the Bot session timeout action will happen and the message for Session timeout will be shared with the user.
* **Skip the Question**: Your customer will move forward in the BotFlow without answering a particular question.
* **Proceed to Fallback**: If an invalid response is encountered, the question will be skipped and will move to the next card connected to the fallback connector🔶.

## **Implementation Example**

Let's design a "Ask Form" Card for a Restaurant.&#x20;

For the **Header Text** you can enter: "*Welcome to Hotel Charminar Palmshore*".

<figure><img src="broken-reference" alt=""><figcaption></figcaption></figure>

For the **Question Text** you can enter: "*Kindly Select from Today's Menu".*

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FjDgUAdiF37oiDR0Pz54W%2FQuestion%20Text%20-%20Ask%20Form.gif?alt=media&#x26;token=fcdcd6e7-b016-464f-bdd8-c4904b105213" alt=""><figcaption></figcaption></figure>

For the **Footer** you can enter any text or leave it blank.&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FauPtpdl5nbUvPlYegwa2%2FFooter%20in%20Ask%20Form.gif?alt=media&#x26;token=3c07a5c8-ad40-40c4-a564-00addb1b26a8" alt=""><figcaption></figcaption></figure>

For the **button name**, you can either enter "View Menu" or "Our Menu"

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FSj2D0EOmRHr8dN5CMTHF%2FButton%20Name%20in%20Ask%20Form.gif?alt=media&#x26;token=9880b0fc-c9fa-4eb2-bd4c-379db90e9713" alt=""><figcaption></figcaption></figure>

Select the relevant WhatsApp Flow you have created in your Business Manager. If you haven't, created any, go to [Flows](https://docs.gallabox.com/whatsapp-flows/create-whatsapp-forms).&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FvncEA7fjx6g319qDcCf7%2FSelect%20WhatsApp%20Flow%20-%20Ask%20Form.gif?alt=media&#x26;token=f4ac57dd-8331-498a-979e-442d03bdba58" alt=""><figcaption></figcaption></figure>

For the **Screen Name** you have to paste the Id of the first screen. You can take it from the JSON format. You will get the Id from your Business Manager.&#x20;

In the below picture, the text enclosed in blue box is the Screen id you have to paste in the Screen Name of Ask Form.

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2Fk94bFG5WpDqFuv0b4Si8%2FScreen%20Id.png?alt=media&#x26;token=cce4355f-a3bd-490e-a9d9-11fb2c85e68f" alt=""><figcaption></figcaption></figure>

You have the option to **store the user response** in the variable. You can create a variable - `user_details` for example to store the user response.

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2F6kOLkz444tMBM27r0ino%2FVariables%20in%20Ask%20Form.gif?alt=media&#x26;token=991ac917-023e-48e3-9b1a-87a65a772790" alt=""><figcaption></figcaption></figure>

Now for the **validation settings**, you could provide the **attempt** limit as 1, Validation Error Message is optional. Kindly provide the **Action on Invalid Response** as [*Proceed to fallback*](https://docs.gallabox.com/bot-essentials#validation-settings-for-cards)*.*&#x20;

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2F6OPZeOvEEAyOpgSyhiCi%2FValidation%20Settings%20in%20Ask%20Form.png?alt=media&#x26;token=f31a0017-599a-42b1-8940-344b063e19f9" alt=""><figcaption></figcaption></figure>

## Sample Flow Using "Ask Form" Card

### In Gallabox Bot Interface

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FVFxEqlVjX2lTazeO1off%2FAsk%20Form%20in%20Gallabox.png?alt=media&#x26;token=6a10b6cf-dd5f-440e-a4aa-eb7cdb5a9a26" alt=""><figcaption></figcaption></figure>

### In WhatsApp

<figure><img src="https://3137140735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZcl3T6ePz95GpzjAeOLW%2Fuploads%2FhVerU5lzmOuu4kdK1sUB%2FAsk%20Flow.gif?alt=media&#x26;token=9c6a04f8-a679-41ae-a4d9-4890933a99ec" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Note:

1. The above sample flow is for you to understand how "**Ask Form**" Card works and it's usage. It is not a representation of what can be achieved with Gallabox.&#x20;
2. All the responses will be collected in a section - [WhatsApp Flows](https://docs.gallabox.com/whatsapp-flows/receiving-response-of-whatsapp-forms) under Settings.
3. You can use this Card if you require input from the user.&#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://docs.gallabox.com/bots/ask-questions/ask-form.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.
