# Ask Phone Number

{% embed url="<https://app.supademo.com/demo/cmm91ikwt5pufdtfhirnyaxdk?utm_source=link>" %}

The **Ask Phone Number** action allows the chatbot to collect a **valid phone number from users** during a conversation.

This action ensures that the user enters a properly formatted phone number, which can be used for contact verification, follow-ups, or customer records.

The collected phone number is stored in a variable and can later be used for automation, CRM updates, or customer communication workflows.

### **When to Use Ask Phone Number**

Use the **Ask Phone Number** action when the chatbot needs to collect a **customer's contact number**.

**Common Use Cases**

* Customer contact collection
* Appointment confirmation
* Order verification
* Lead generation
* Support request follow-up

Example interaction:

Bot: We need your phone number to confirm your appointment.\
Please enter it with the country code.\
\
User: 919876543210

The chatbot captures and stores the phone number for later use.

### **How to Add Ask Phone Number**

Follow these steps to add the Ask Phone Number action in your bot workflow.

* Open **Bot Builder**
* Click **Add Node**
* Select the **Ask** tab
* Choose **Ask Phone Number**
* Configure the required fields
* Click **Create**

The chatbot will pause at this step until the user enters a valid phone number.

### **Ask Phone Number Configuration**

When creating an Ask Phone Number action, several fields must be configured.

#### **Action Name**

The **Action Name** identifies the action within the bot workflow.

This name is visible only inside the bot builder.

Example:

Collect Phone Number\
Customer Contact Input\
Verify Phone Number

#### **Message**

The **Message** field contains the prompt shown to the user.

Example:

Hello 👋\
\
We need your phone number to confirm your appointment.\
Please enter it in the format: 919876543210

The message supports:

* Dynamic variables
* Text formatting
* Emojis

Variables can be inserted using the **Add Variable** option.

#### **Adding Variables**

The **Add Variable** option allows dynamic values to be included in the message.

Examples include:

* Customer name
* Phone number
* Email
* Contact details

Example:

Hi {{customer.name}}

This helps personalize the interaction.

#### **Error Attempt**

The **Error Attempt** field defines the number of invalid attempts allowed.

Example:

Error Attempt: 2

If the user enters an invalid response multiple times, the chatbot will follow the configured **Action on Invalid**.

#### **Error Message**

The **Error Message** is displayed when the user provides an invalid phone number.

Example:

Please provide a proper phone number so we can continue.\
Example: 919876543210

This helps guide users to enter the correct format.

#### **Action on Invalid**

This setting defines the behavior when the user exceeds the allowed error attempts.

Available options include:

**End the Flow**

Stops the chatbot conversation.

**Skip the Question**

Allows the chatbot to continue without collecting the phone number.

**Fall Back Flow**

Redirects the user to another predefined chatbot flow.

#### **Validation Settings**

The **Validation Setting** ensures the phone number meets the required length.

When enabled, you can define:

**Minimum Characters**

Example:

Min Characters: 10

**Maximum Characters**

Example:

Max Characters: 12

These limits help ensure the user enters a valid phone number format.

### **Store Response in Variable**

The **Store Response in Variable** field saves the collected phone number.

Example variable:

phonenumber\_collect

This stored value can be used for:

* Customer records
* Marketing campaigns
* WhatsApp broadcasts
* Follow-up communication

#### **Example Ask Phone Number Interaction**

Example chatbot conversation:

Bot: Hello 👋\
We need your phone number to confirm your appointment.\
Please enter it in the format: 919876543210\
\
User: 919876543210

The chatbot stores the number in the variable:

phonenumber\_collect

and continues the workflow.

### **Best Practices**

Follow these recommendations when using Ask Phone Number.

**Provide clear formatting instructions**

Tell users whether to include the country code.

**Use validation settings**

Ensure phone numbers meet the expected length.

**Provide helpful error messages**

Guide users when incorrect input is entered.

**Store phone numbers securely**

Use variables for later automation or CRM integration.

**Personalize messages**

Include dynamic variables when possible.

### **Summary**

The **Ask Phone Number** action enables chatbots to collect **valid phone numbers from users** during conversations.

With Ask Phone Number, you can:

* Capture customer contact numbers
* Validate phone number format
* Limit incorrect input attempts
* Store phone numbers in variables
* Use collected data for automation and communication

This feature helps ensure **accurate contact data collection for business workflows and customer engagement**.


---

# 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.ownchat.app/bot/ask-action/ask-phone-number.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.
