Configure for Location Accuracy
After completing this unit, you’ll be able to:
- Explain the Salesforce Maps geocoding process.
- Configure base objects in Salesforce Maps.
- Configure Salesforce Maps for address changes.
Let’s say you’re on a business trip searching for a nearby restaurant on your phone. Pins appear on the map, you select a nearby restaurant, and get turn-by-turn directions. You trust your mapping application to place markers on the map in the correct location.
Imagine your frustration and disappointment if the returned location was inaccurate, and you ended up at an abandoned warehouse. Location accuracy is critical for every mapping situation. With Salesforce Maps, companies rely on location accuracy to ensure their users can visualize data, plan territories, and create accurate routes and schedules. To ensure this is done properly, organizations must configure their environment with location data and tell Salesforce Maps where that data is stored.
The Geocoding Process
The first step in the process is understanding how Salesforce Maps reads location data. This is done through geocoding, which converts addresses into geographic coordinates (like latitude and longitude). You can use these coordinates to place markers on a map or adjust its position. In the world of Salesforce Maps, a Salesforce record must point to latitude and longitude fields that are populated with coordinates in order to be plotted on a map.
A typical geocoding process will start with a physical address on a record in Salesforce like the billing address on the account record. Users trigger geocoding in one of two ways: on demand by plotting a record on the map, or through batch automation, which runs a batch to automatically geocode records. Once triggered, Salesforce Maps reaches out to a geocoding API to convert the physical address into latitude and longitude coordinates. Those coordinates are stored on fields in Salesforce and used to place markers on the map.
So, how does Salesforce Maps know which address and coordinate fields to use?
The answer lies in the configuration of base objects.
Get to Know Base Objects
To understand base objects, let’s conduct a short review of Salesforce objects. Salesforce supports several different types of objects. The two most common types are standard and custom objects.
- Standard objects are objects that are included with Salesforce. Account, Contact, Lead, and Opportunity are all standard objects.
- Custom objects are objects that you create to store information that’s specific to your company or industry.
Think of objects as containers for your information. For example, the account object contains all of your account records. With that in mind, first determine which records you would like to display on the map and select the container for these records as your base object.
Second, identify where the address and latitude/longitude fields are stored. These fields can be stored on the base object or an associated object. In many cases, the address fields for the opportunity object are located on the account object.
Finally, select which address, latitude, and longitude fields to use. You’ve now configured a base object. Once saved, Salesforce Maps will know which address fields to geocode (if they’re not already geocoded) and which latitude and longitude fields to read when plotting data on the map.
When selecting latitude and longitude fields, you can use either standard latitude and longitude fields or you can create custom fields. If creating custom latitude and longitude fields, select the number field type and identify length as 3 and decimal place as 15.
As a best practice, plan your base object configuration by determining which object(s) will be used to visualize data in Salesforce Maps. It’s helpful to create a chart that identifies the address and latitude and longitude fields for each object. This is especially helpful if your organization will be plotting data from multiple objects and different standard and custom location fields.
Here’s an example chart.
||Base Object Name
||Latitude and Longitude Coordinate Fields
|Standard fields—Billing Latitude and Billing Longitude
||Shipping address fields
||Standard fields—Shipping Latitude and Shipping Longitude
||Standard address fields
||Standard fields—Latitude and Longitude
|Standard field—Billing Latitude and Billing Longitude
||Custom address fields
||Custom fields—Maps Latitude and Maps Longitude fields
Imagine you received a promotion, but it requires you to relocate to a different state. Once you move, you need to notify people of your new address. The same is true for records in Salesforce. When a company moves its physical location, you must update the address fields in Salesforce. However, if you aren’t using data integration rules, updating the physical address fields won’t automatically update the latitude and longitude coordinates for records previously geocoded. You will need to ensure that Salesforce Maps is aware of the address change, removes the latitude and longitude coordinates and, when triggered, geocodes the record using the updated address. Fortunately, you can automate this process in a number of ways.
- Configure Workflow Rules or Process Builder to tell Salesforce Maps to automatically clear coordinates when an address changes in Salesforce.
- Use Batch automation to schedule the automatic removal of latitude or longitude coordinates for an object. This is normally done if all records for an object require new coordinates.
If you have activated data integration rules and you are using standard geocode fields on the account, contact and lead, the latitude and longitude values are automatically updated when the physical address changes.
Now that you’re familiar with the geocoding process in Salesforce Maps, in the next unit, we explore some additional Salesforce Maps features.
- External Site: Get Started | Geocoding API
- Salesforce Help: Clearing Coordinates for Multiple Accounts in Salesforce Maps
- Trailhead: Quick Start: Process Builder
- Salesforce Help: Batch Automation for Geocoding records in Maps
- Salesforce Help: Get Geocodes for Addresses in Your Records
- Salesforce Help: Manage Objects to Plot on Maps
- Trailhead: Data Modeling