Create a Geolocation Field¶
Overview¶
Note: Geocoding is licensed separately from address verification. Check your subscription includes it before creating this field.
AddressTools can return the latitude and longitude of a verified address. Coordinates on the record let you use Salesforce mapping, plan territories, run proximity searches, and drive location-based automation.
Geocoding is only available from AddressTools v10 and onwards.
Note: The standard Salesforce address fields, and Salesforce's compound Address field type, already include latitude and longitude components. Create this field when your address is built from separate text fields, which have no coordinates of their own.
Step 1: Create the Field¶
- Navigate to Setup > Object Manager.
- Select the object, then select Fields & Relationships.
- Click New.
- Choose Geolocation as the data type and click Next.
- Enter a Field Label naming the address it belongs to, for example
Billing Geolocation. - Set Latitude and Longitude Display Notation to Decimal.
- Set Decimal Places to
15. - Click Next.
- Provide visibility to all the users who will be verifying addresses, then click Next.
- Add the field to the page layouts where you want the coordinates visible, then click Save.
Note: A geolocation field is a compound field: Salesforce creates a latitude component and a longitude component, and AddressTools maps to each separately.
Step 2: Map it on the Address Block¶
- Click the App Launcher to search for and select AddressTools Administration.
- Select Address Blocks from the left menu.
- Open the block for this address by using the dropdown to select Edit.
- In the Location Fields section, set Latitude Field and Longitude Field to the latitude and longitude components of the field you just created.
- Click Save.
When Coordinates Are Written¶
Coordinates are returned when an address runs through verification, and you have the appropriate geocoding license. If an address only partially matches, the coordinates point at the closest match found rather than at the address itself. Create a geocode accuracy field to record how precise they are. See Create a Geocode Accuracy Field.
The geolocation field is populated by address verification, so to fully enable this follow the setup steps in Verification and make sure you have the correct license.