> For the complete documentation index, see [llms.txt](https://docs.ownchat.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ownchat.app/bot/ask-action/ask-location.md).

# Ask Location

The **Ask Location** action allows the chatbot to collect the **user's geographical location** during a conversation.

This action prompts the user to share their location using the messaging platform's **location-sharing feature**. Once the user shares their location, the chatbot captures the **latitude and longitude coordinates** of the selected location.

The captured location data can be stored in a variable and used later in the chatbot workflow for delivery services, appointment scheduling, service availability checks, or location-based automation.

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

### **When to Use Ask Location**

Use the **Ask Location** action when the chatbot needs to collect the **user's physical location**.

**Common Use Cases**

* Delivery address verification
* Finding nearby service providers
* Location-based service availability
* Pickup or drop-off coordination
* Event check-in locations

Example interaction:

Bot: Please share your current location so we can continue with your request.\
\
User: 📍 Shares location

The chatbot then captures the coordinates of the shared location.

### **How to Add Ask Location**

Follow these steps to add the Ask Location action to your bot workflow.

* Open **Bot Builder**
* Click **Add Node**

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

* Select the **Ask** tab
* Choose **Ask Location**

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

* Configure the required fields
* Click **Create**

Once added, the chatbot pauses at this step until the user shares their location.

### **Ask Location Configuration**

When creating an Ask Location action, several configuration fields must be completed.

#### **Action Name**

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

This name is visible only within the bot builder.

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

Example:

Collect User Location\
Capture Delivery Location\
Get Customer Coordinates

The walkthrough example uses **"Collect User Location"** as the action name.

#### **Message**

The **Message** field contains the prompt shown to the user requesting their location.

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

Example:

Please share your current location so we can continue with your request.

This message instructs users to share their location using the messaging platform's location feature.

The message supports:

* Dynamic variables
* Text formatting
* Emojis

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

#### **Error Attempt**

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

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

Example:

Error Attempt: 3

If the user fails to share a valid location multiple times, the chatbot triggers the configured **Action on Invalid** behavior.

#### **Error Message**

The **Error Message** is displayed when the user provides an invalid response instead of sharing a location.

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

Example:

Please share a valid location to proceed.

This helps guide users to share their location correctly.

#### **Action on Invalid**

This setting determines how the chatbot responds when the maximum error attempts are exceeded.

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

Available options include:

**End the Flow**

Stops the chatbot conversation.

**Skip the Question**

Allows the chatbot to continue the workflow without collecting location data.

**Fall Back Flow**

Redirects the user to another predefined chatbot flow.

### **Store Response in Variable**

The **Store Response in Variable** option saves the captured location data.

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

Example variable:

user\_location

The walkthrough demonstrates creating a new variable named **User\_Location** to store the collected coordinates.

#### **Creating a New Variable**

If no suitable variable exists, follow these steps:

* Click **Create New Variable**.
* Enter the variable name.

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

**Example:**

User\_Location

3. Select the variable in the Store Response field.
4. Data Captured by Ask Location &#x20;

When the user shares their location, the chatbot captures:

* Latitude
* Longitude
* Map location reference

These coordinates allow the system to identify the user’s exact geographic position.

### Save and Deploy &#x20;

After configuring the action:

1. Click **Create** to add the action to the flow<br>

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

2. Connect the node appropriately
3. Click **Publish** to deploy the configuration

### **Data Captured by Ask Location**

When the user shares their location, the chatbot captures:

* Latitude
* Longitude
* Map location reference

These coordinates allow the system to identify the user's exact geographic position.

#### **Example Ask Location Interaction**

Example chatbot conversation:

Bot: Please share your current location so we can continue with your request.\
\
User: 📍 Shares location

The chatbot stores the location coordinates in the variable:

User\_Location

and continues the workflow.

### **Best Practices**

Follow these recommendations when using Ask Location.

**Clearly explain why location is needed**

Users are more likely to share their location when they understand the purpose.

**Provide clear instructions**

Tell users to use the **location sharing option** in the chat.

**Handle invalid responses**

Use helpful error messages when users send incorrect input.

**Store location properly**

Save coordinates in variables for later processing.

**Use location data responsibly**

Ensure location data is used only for the intended service.

### **Summary**

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

The **Ask Location** action allows chatbots to collect **user location data through map-based sharing**.

With Ask Location, you can:

* Collect geographic coordinates from users
* Request location sharing through chat platforms
* Validate location input
* Store coordinates in variables
* Use location data for delivery, navigation, and service automation

This feature helps businesses provide **location-based services and improve operational efficiency through chatbot automation**.
