🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials October 18, 2026

Gravity Forms Nearest Location: Geolocate Every Entry and Route It to the Closest Branch

GravityExtra
Gravity Forms Nearest Location: Geolocate Every Entry and Route It to the Closest Branch

A dental group with five clinics, a dealer network, a franchise, a delivery service, a mobile repair team: they all get requests from a website form, and every one of those requests has to land with the right branch. In many offices that still happens by hand. Someone opens the notification, reads the address, looks it up on a map, decides which location is closest and forwards the e-mail. On a busy morning the requests pile up in a shared inbox, and the customer who asked for the nearest appointment waits for someone to do geography.

The form already holds the answer. The visitor either knows where they are or typed their address a few fields earlier. This guide shows how to turn that into a position with latitude and longitude, pick the nearest of your locations, show it on the form, and route the entry to that branch automatically — with the Gravity Forms Nearest Location Premium Add-on, OpenStreetMap and no Google key.

Why Location Matters on a Form

Location changes what you should do with a request. A clinic wants the patient at the branch they can actually reach. A dealer group wants the lead with the showroom in that town, not with head office. A home-service company wants to know before anybody calls back whether the address is inside the area it covers. And whoever manages the business wants to see on a map where the requests come from.

Gravity Forms has a solid Address field, but an address is only text. It cannot tell you that 233 South Wacker Drive is 0.9 km from your Loop clinic and 19 km from your Oak Park clinic. Conditional logic cannot compare distances, a notification cannot pick a recipient by area, and the entry has no map. The usual workarounds are a long drop-down of branches that customers pick wrongly, a ZIP code list that is out of date the day it is written, or a person who sorts every request.

Why Store-Locator Services and Zapier Are the Wrong Tool

Store-locator services can draw nice maps, but they live outside your form. You embed their widget, pay per month, and still need a Zapier or Make scenario to copy each entry, geocode it and send it on. Each step adds a fee, a delay and a place where it can break quietly. Most of them also want a Google Maps key, which means a billing account, quotas and a key that has to be protected.

There is a privacy side too. A position is personal data. Every extra service that receives it is another processor to list in your privacy policy, and for clinics and law firms that matters. Keeping the position with the entry, on your own site, is simpler to explain and simpler to delete.

Feature / metric GravityExtra add-on Store-locator SaaS + Zapier Manual sorting
Annual cost From $39 a year $240–$900 a year plus map API fees Staff time on every request
Setup time About 15 minutes Hours: widget, zap, field mapping None, but never finished
API key needed No (free Nominatim + OpenStreetMap) Usually a Google Maps key No
Data stays on your site Yes, saved with the entry Copied to another service Yes
Speed of routing Instant, before the form is sent Minutes, if the zap runs Hours or the next day
Maintenance Edit the Locations page Keep two systems in sync Someone must know every area

How the Nearest Location Add-on Works

The add-on adds a Nearest Location field. It shows a Use my current location button with a short privacy note; the browser asks the visitor only after they click. If they prefer not to share, they type their address in the Address field and the add-on looks it up when they leave the field. Either way the form shows the nearest of your locations, its distance and address, a moment later.

When the form is sent, everything is recalculated on your server: the address is geocoded (or the shared position checked), the nearest active location is found, and the latitude, longitude, address, source, accuracy, nearest location and distance are saved with the entry. Addresses are looked up with free OpenStreetMap Nominatim — at most one request per second for the whole site, with your site and contact e-mail in every request, and every result cached for 30 days — or with Google Geocoding and your own key.

Gravity Forms booking form with the Nearest Location field: a Use my current location button, a privacy note, Location shared with the accuracy, and the nearest clinic Lincoln Park Clinic 1.2 km away with its address
The form after the visitor shared their location: the nearest clinic and the distance appear right away.

Step-by-Step: From Form to the Right Branch

1. Choose the geocoding service

Under Forms → Settings → Nearest Location, keep OpenStreetMap Nominatim and enter a contact e-mail, or choose Google Geocoding API and paste your own key. Pick kilometres or miles and how exactly coordinates are saved; rounding to about 100 m is a good privacy choice for many businesses.

2. Add your locations

Open Forms → Nearest Location and add each branch with its name, address, e-mail and phone. Leave latitude and longitude empty and they are looked up for you. With many branches, paste them one per line into Add many locations. Groups such as “Clinics” and “Depots” let different forms compare different lists.

Locations page of the add-on: a map with six locations around Chicago, the Add a location form with name, address, latitude, longitude, e-mail, phone and group, and the list of locations with coordinates and contact details
The Locations page: your branches on a map, the add form and the list with coordinates, contacts and groups.

3. Add the field to your form

In the form editor, add Nearest Location from Advanced Fields below the Address field. Choose the Address field to look up, keep the location button on, and set a Service radius if you only serve a certain area. Tick Do not accept requests outside the radius to stop requests you cannot handle, or leave it off and only show the message.

4. Route the notification

Open the admin notification and put {nearest_location_email} in Send To Email. Use {nearest_location} in the subject and {nearest_distance}, {geo_address} and {geo_map_link} in the message, so the branch sees at a glance who is asking, from where, and how far away they are.

5. Review entries on the map

Each entry shows a Location box with an OpenStreetMap map of the visitor and the nearest branch, the address, the coordinates and the accuracy of a shared position, plus links to open the place or a route on openstreetmap.org. The nearest location and distance can also be columns in the entry list and filters in exports.

Location box on a Gravity Forms entry: OpenStreetMap map with the entry location and the nearest clinic joined by a dashed line, the nearest location with distance and address, the street address, coordinates, source and accuracy, and Open in OpenStreetMap and Directions buttons
Every entry gets a map with the visitor and the nearest location, plus the saved address, coordinates and accuracy.

Pro Tips for Multi-Location Businesses

Use conditional logic on the distance. The field’s Distance input works in conditional logic: show a “Would you like a home visit?” question when the distance is greater than 15, or a different set of appointment times for far-away visitors.

Show branch-specific details. A rule on “Nearest location is Evanston Clinic” can show the parking note or opening hours of that branch. The rule offers your location names in a drop-down, so there is nothing to type.

Escalate unusual requests. A second notification with the condition “Distance to nearest location is greater than 40” can go to the head office, which may want to call those customers personally.

Keep separate lists with groups. A booking form can compare only the clinics, while a supplier form compares only the depots — one Locations page, two groups.

Privacy and Fair Use

The browser position is only requested after a click, and the privacy note under the button says what it is used for. Saved coordinates can be rounded to about 10 m, 100 m or 1 km. Addresses go to the geocoding service you choose and the entry map loads tiles from OpenStreetMap; nothing passes through GravityExtra. The add-on follows the Nominatim usage policy: one request per second, an identifying User-Agent, a contact e-mail and caching of results.

Send Every Request to the Right Branch

Browser location or address lookup, the nearest of your locations with the distance, and a map on every entry — without a Google key.

Frequently Asked Questions

Do I need a Google Maps API key?

No. Address lookup uses free OpenStreetMap Nominatim and the entry map uses OpenStreetMap tiles with Leaflet, which is included. Google Geocoding is an option for sites that prefer it, with their own key.

What if the visitor does not want to share their location?

Nothing is asked until they click the button. They can simply type their address; the nearest location is found from it. If they refuse the browser prompt, the form says so and uses the address instead.

Is the distance the driving distance?

It is the straight-line distance, which is what you need to pick the closest branch. Each entry has a Directions link for the route.

Can I route the request to the branch e-mail?

Yes. Put {nearest_location_email} in the notification’s Send To Email. The e-mail addresses of your locations are never shown on the form.

Which Gravity Forms version do I need?

Gravity Forms 2.9 or newer, any licence, with WordPress 6.5 and PHP 7.4 or newer. The site must use HTTPS for browser locations.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr