Skip to content

Tasks

Address autocomplete

An address field that suggests real addresses as people type, from Google Maps Platform or Azure Maps, and stores the formatted address plus city, postcode, latitude and longitude for workflows.

Last updated 2 min read Edit this page on GitHub
On this page

The Address autocomplete control suggests real addresses as people type. When someone picks a suggestion, the field gets the formatted address, and the parts of the address (street, city, region, postcode, country, coordinates) are stored beside it for workflows. You can use it in forms and task forms (field type address), in app prompts (kind address), and in an app's Input widget (kind address).

Suggestions come from a map connector: Google Maps Platform or Azure Maps. Add one first.

Add it to a form#

  1. In the form designer, drag Address autocomplete from the Text group of the palette.
  2. In its properties, choose the Map connector.
  3. Optionally set:
    • Countries: only suggest addresses in these countries (US, CA). Empty uses the connector's setting.
    • Allow typing an address that isn't a suggestion: on by default. When it's off, the form can't be submitted until an address is picked.
    • Value for workflows: the formatted address as text (default), or the address object.
    • Fill other fields when an address is picked: copy parts of the address into other fields, for example Address line 1 → street, City → city, Postcode → zip, Latitude → lat.
    • Suggestions on public form links: off by default. Turn it on to let anonymous visitors of a public link get suggestions. Each one counts against your map quota.

What is stored#

ValueExample
{{task_data.location}} (the field)1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA
{{task_data.location_address}}the picked address, or null when typed by hand
{{task_data.location_address.line1}}1600 Amphitheatre Pkwy
.line2, .city, .region, .postcode`, Mountain View, CA, 94043`
.country, .country_codeUnited States, US
.lat, .lng37.4220, -122.0841
.place_id, .providerthe provider's id, google or azure

With Value for workflows: Address object, the field itself holds the object: {{task_data.location.city}}, {{task_data.location.formatted}}. A typed address is still text.

If someone edits the text after picking, the picked address is dropped and the text is kept as a manual entry.

In apps#

Prompt fields: in the app spec, a prompt field of kind address:

JSON
{ "name": "location", "label": "Address", "kind": "address",
  "address": { "connector_id": "<map connector id>", "countries": ["US"] } }

{{prompt.location}} is the formatted address. {{prompt.location_address.city}}, .postcode, .lat and .lng are its parts, for example latitude: "{{prompt.location_address.lat}}" in a Start workflow button's inputs.

Input widget: kind: "address" with address: { connector_id }. The bound variable gets the formatted address. Declare a variable named <variable>_address to get the picked address too.

Security and reliability#

  • Keys stay on the server. The browser asks UserTasks for suggestions and says only where the control is (a task, a form, an app page) and which field. The server reads the connector from the saved field. A request can't name another connector, and the connector must belong to the same workspace.
  • Who can ask: people who can fill in the task or form, or open the app page. On public form links, only when the designer turned on Suggestions on public form links for that field.
  • Limits: at most 60 searches a minute per person (or per visitor IP address on public links), 3 to 200 characters per search, and a short pause in typing before each search.
  • If the provider fails (a quota, an outage, a revoked key), the control says so and works as a plain text field. A field that doesn't allow manual entry then can't be submitted until suggestions work again.

Was this page helpful?