# Request User Location

The WhatsApp Location Request function allows you to request a user's location through WhatsApp. This function creates an interactive message with a location request button that prompts the user to share their current location.

#### **Implementation**

To use this function in your Voiceflow project:

1. Upload the custom function downloaded from the Custom Functions page on your FlowBridge environment, to your Voiceflow project as a custom function.
2. Add a Custom Function block in your Voiceflow flow.
3. Select the uploaded WhatsApp location request function.
4. Configure the input variables

#### **Input Parameters**

The function accepts the following input parameter:

* `bodyText`: The message to display when requesting the location (e.g., "Please share your location to find nearby stores")

If no bodyText is provided, a default message "Please share your location" will be used.

#### **Accessing Location Data**

When a user responds with their location, the following variables will be available in your Voiceflow project:

* `location_address`: The address of the shared location (if available)
* `location_latitude`: The latitude coordinate
* `location_longitude`: The longitude coordinate
* `location_name`: The name of the location (if available)
* `location_url`: A URL to the location (if available)

Once location data is received, we will also automatically send a message as text to Voiceflow which contains a stringified JSON object of the location data. This is done so that you can use a capture step to wait for the reponse, and continue after.

#### **Example**

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

![image.png](attachment:e096a75f-3763-4200-9a11-748ed7ebcc13:image.png)

![image.png](attachment:12ee5e7d-b425-44b7-b2de-882146f9f853:image.png)


---

# 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.flowbridge.app/documentation/social-integrations/whatsapp/request-user-location.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.
