Enable Geocoding¶
Overview¶
Geocoding resolves an address to a point on the map. AddressTools returns the latitude and longitude of a verified address, together with a geocode accuracy value recording how precisely those coordinates pinpoint it. Coordinates on the record let you place it on a map, calculate distances, plan territories, and drive location-based automation.
Geocoding runs as part of address verification, so the location fields are populated when an address is verified. See When Coordinates Are Written.
Note
Geocoding lookups are purchased separately from address verification lookups, so an org that can verify addresses does not necessarily have geocoding. If your org does not hold geocoding lookups, contact sales@provenworks.com.
Note
A specific geocode accuracy value is only returned by batch and record-triggered flow verification. PowerSearch sets the geocode accuracy field to Unknown.
Before You Start¶
The object needs three fields to hold the values. Standard Salesforce address fields already include latitude, longitude and geocode accuracy components. For a custom address you create them yourself. See Create a Geolocation Field and Create a Geocode Accuracy Field.
Verification also has to be working on that address block, since coordinates arrive with the verified address. See Verification.
Step 1: Map the Location Fields¶
There is no separate switch for geocoding. Mapping the fields on the address block enables it.
Note
The address blocks supplied out of the box already have their location fields mapped to the standard latitude, longitude and geocode accuracy components. Confirm the mapping rather than creating it if you are working with those blocks.
- 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, for example
BillingLatitude - Longitude Field, for example
BillingLongitude - Geocode Accuracy Field, for example
BillingGeocodeAccuracy
- Latitude Field, for example
- Click Save.
Repeat for each address block where you want coordinates stored.
Step 2: Confirm the Configuration¶
Mapping the location fields is not enough on its own: verification must also be enabled for the org and for this address block before anything populates, so complete the steps in Verification first.
- Verify an address, either through PowerSearch or one of the automated options.
- Look at the latitude and longitude fields on the record.
- To check the geocode accuracy field, verify through a batch run or a flow, as PowerSearch sets it to Unknown.
When Coordinates Are Written¶
With PowerSearch, the user selects a verified address, so the latitude, longitude and geocode accuracy are written together with it.
With batch and record-triggered flow verification, the latitude, longitude and geocode accuracy are written whenever the service returns coordinates, whatever the address status. A record can therefore gain coordinates even where the address was not verified closely enough for the rest of it to be updated.
If an address only partially matches, the coordinates point at the closest match found rather than at the address itself. The accuracy value records that difference. It runs from Address at the most precise, through street and postal code levels, down to State, with Unknown where no accuracy was returned. See Create a Geocode Accuracy Field for the full list.
Warning
Editing an address resets its status to Not checked on save, and clears the latitude, longitude and geocode accuracy fields at the same time. The coordinates describe the address that was verified, so they do not survive a change to that address. Where a user edited the coordinates directly, those values are kept and the accuracy is set to Unknown. This behaviour requires an address status field mapped on the block.
Compared With Salesforce Geocoding¶
Salesforce's own geocoding runs asynchronously in the background and covers particular standard objects. AddressTools returns coordinates as part of the verification response, on any object where you have configured an address block, so the values are there as soon as the address is verified.