> ## Documentation Index
> Fetch the complete documentation index at: https://docs.release0.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Address element to autocomplete location inputs

> Collect structured address inputs with Google Maps Autocomplete, allowing users to search for locations easily in your chatbot agent.

The **Address** User Input element enhances user experience by allowing users to **autocomplete address inputs** using the **Google Maps API**. This is particularly useful for agents that need structured location data such as street addresses, cities, or postal codes.

<Frame style={{ maxWidth: '600px' }}>
  <img src="https://mintcdn.com/release0-13d037a7/BMYN_fruDBtiWNDa/images/elements/inputs/address-agent-live.gif?s=839ae0251b5dc2f6f9fc43f11d5b1563" alt="Release0.com - Search Address Agent" width="1648" height="1142" data-path="images/elements/inputs/address-agent-live.gif" />
</Frame>

***

## Key Features

* **Required field**: Ensures users provide a valid address before proceeding.
* **Restrict to list only**: When enabled, users can only select addresses suggested by Google Maps. Typing custom addresses will not be allowed and the element will prevent submission until a valid suggestion is selected.
* **Placeholder Text**: Customizable prompt to guide users (e.g., "Enter your address").
* **Include postal code**: When enabled, the postal code will be included in the address returned by Google Maps. This is useful if you need more accurate location data.
* **Language**: Selects the language used to fetch results from Google Maps.
* **Button label**: Customizable button text for the search action.
* **Save answers in Variable**: Save the selected address in your desired variable.

***

## How It Works

1. The element renders a text input powered by Google Places Autocomplete.
2. As the user types, location suggestions appear.
3. When the user selects a suggestion, the formatted address is saved in the specified variable.

***

## Setup Instructions

### 1. Add the Address Input element

* Drag and drop the **Address** input element into your flow.
* Configure the **Prompt** to ask users for their location (e.g., "Can you provide your address?").

<Frame style={{ maxWidth: '600px' }}>
  <img src="https://mintcdn.com/release0-13d037a7/BMYN_fruDBtiWNDa/images/elements/inputs/address-drag.png?fit=max&auto=format&n=BMYN_fruDBtiWNDa&q=85&s=c9530b74c065c6389bdab3434a38197f" alt="Release0.com - Add Address input element" width="1767" height="1400" data-path="images/elements/inputs/address-drag.png" />
</Frame>

### 2. Google Maps API Key

* This element requires a valid **Google Maps JavaScript API key**. We provide a limited number of free requests, but you will need to set up your own key for production use.
* Go to the [Google Cloud Console](https://console.cloud.google.com/google/maps-apis/credentials) to generate an API key.
* Ensure your key has the **Places API** enabled.
* Add your key to the environment or agent settings under **Google Maps API Key**.

<Frame style={{ maxWidth: '400px' }}>
  <img src="https://mintcdn.com/release0-13d037a7/BMYN_fruDBtiWNDa/images/elements/inputs/address.png?fit=max&auto=format&n=BMYN_fruDBtiWNDa&q=85&s=e21891811563bcc2229d29d691961ed4" alt="Release0.com - Address input element" width="1060" height="992" data-path="images/elements/inputs/address.png" />
</Frame>

> **Note**: After changing your Google Maps API key, you need to wait for **5 minutes** for the changes to take effect.

### 3. Save Address to a Variable

* Assign a variable name to store the selected address.
* This variable will contain the full address string returned by Google.

<Frame style={{ maxWidth: '600px' }}>
  <img src="https://mintcdn.com/release0-13d037a7/BMYN_fruDBtiWNDa/images/elements/inputs/address-variable.png?fit=max&auto=format&n=BMYN_fruDBtiWNDa&q=85&s=e1e3ea34327faf7b6ae61d881dff076a" alt="Release0.com - Save Address variable" width="1332" height="998" data-path="images/elements/inputs/address-variable.png" />
</Frame>

***

## Example Configuration

* **Prompt**: `"Where should we send your delivery?"`
* **Variable**: `user_address`

Once selected, the variable `user_address` will store something like:\
`"742 West Evergreen Street, Springfield, Misuri, EE. UU."`

<Frame style={{ maxWidth: '600px' }}>
  <img src="https://mintcdn.com/release0-13d037a7/BMYN_fruDBtiWNDa/images/elements/inputs/address-agent.png?fit=max&auto=format&n=BMYN_fruDBtiWNDa&q=85&s=c144747f8bcf72c914017e1ae3eeae0e" alt="Release0.com - Search Address Agent" width="1652" height="1088" data-path="images/elements/inputs/address-agent.png" />
</Frame>

***

## Use Cases

* Delivery address collection
* Event location input
* Property lookup
* Booking/reservation systems

***

## Limitations

* Requires an active Google Maps API key.
* The accuracy and format of address results depend on Google's database.
* Not suited for offline or custom location lists.
