Join the Team Forms community

Updated 4 months ago

Address component / Limit address

At a glance

A community member, Katia, asked if it is possible to limit the address component to 2 or 3 cities in Belgium. Another community member responded that the address component uses Google address autocomplete, and provided two examples of how to configure the component to constrain the autocomplete results using "provider options": 1) Constrain address autocomplete to Belgium, and 2) Constrain address to a specific area using a bounding box. The community member also recommended reading Google's official documentation for more specific needs.

Hi everybody,

I would like to limit the address component to 2 or 3 cities in Belgium.

Is it possible?

Thank you in advance.

Katia

Marked as solution

Hi Katia,

The address component uses google address autocomplete. This means you can configure the component to constrain the autocomplete results using the "provider options". Here are some examples of how you could use these settings to constrain the available addresses however I recommend having a read on googles official documentation if you need something more specific.


Example 1 - Constrain address autocomplete to Belgium

  1. Open the component settings for the address component and navigate to the "Provider" tab

  2. Locate the Provider Options property and enter the following option in JSON format

JSON
 {
   "componentRestrictions": { "country": "BE" }
 }


Example 2 - Constrain address to specific area using bounding box

  1. Open the component settings for the address component and navigate to the "Provider" tab

  2. Locate the Provider Options property and enter the following option in JSON format

JSON
{
  "bounds":{
    "north": 50.952531,  
    "south": 50.752531,
    "east": 4.452764,
    "west": 4.252764
  }
}


Here is an example of the end result:

Team Forms filtered/constrained address component
View full solution
E
1 comment

Hi Katia,

The address component uses google address autocomplete. This means you can configure the component to constrain the autocomplete results using the "provider options". Here are some examples of how you could use these settings to constrain the available addresses however I recommend having a read on googles official documentation if you need something more specific.


Example 1 - Constrain address autocomplete to Belgium

  1. Open the component settings for the address component and navigate to the "Provider" tab

  2. Locate the Provider Options property and enter the following option in JSON format

JSON
 {
   "componentRestrictions": { "country": "BE" }
 }


Example 2 - Constrain address to specific area using bounding box

  1. Open the component settings for the address component and navigate to the "Provider" tab

  2. Locate the Provider Options property and enter the following option in JSON format

JSON
{
  "bounds":{
    "north": 50.952531,  
    "south": 50.752531,
    "east": 4.452764,
    "west": 4.252764
  }
}


Here is an example of the end result:

Team Forms filtered/constrained address component