> For the complete documentation index, see [llms.txt](https://docs.flowbridge.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowbridge.app/documentation/social-integrations/whatsapp/request-user-location.md).

# 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)
