Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Configure for Location Accuracy

Learning Objectives

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 then get turn-by-turn directions. You trust your mapping application to place markers on the map in the correct location.

Sound familiar?

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, in order to be plotted on a map a Salesforce record must point to latitude and longitude fields that are populated with coordinates. 

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.  

Note

Data integration rules can also be used to update your accounts, contacts, and leads with geocodes.

Geocode fields are available for standard addresses on accounts, contacts, and leads in Salesforce. These fields aren’t visible on records but can be viewed by using the Salesforce API.

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. 

Screenshot shows the Base Object page in the Salesforce Maps configuration menu. The Create New and the Base Object dropdown menu are highlighted.

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.  

Screenshot shows the base object menu. The base object selection fields and the address location field are both highlighted.

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.

Screenshot shows the second step of creating a field in the account object. The Length and Decimal Places are highlighted.

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. 

Object Name

Base Object Name

Address Location

Address Fields

Latitude and Longitude Coordinate Fields

Account

Account Billing

Account object

Billing address

fields

Standard fields—Billing Latitude and Billing Longitude

Account

Account Shipping

Account object

Shipping address fields

Standard fields—Shipping Latitude and Shipping Longitude

Contact

Contacts

Contact object

Standard address fields

Standard fields—Latitude and Longitude

Opportunity

Opportunity

Account object

Billing address

fields

Standard field—Billing Latitude and Billing Longitude

Task

Tasks

Task object

Custom address fields

Custom fields—Maps Latitude and Maps Longitude fields

Address Changes

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 Flow Builder to clear coordinate fields 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.

Note

Configuring automation is the recommended process, but you can also manually clear coordinates for one marker or multiple markers after records are plotted on the map.

Summary

Now that you’re familiar with the geocoding process in Salesforce Maps, in the next unit, we explore some additional Salesforce Maps features. 

Resources

Compartilhe seu feedback do Trailhead usando a Ajuda do Salesforce.

Queremos saber sobre sua experiência com o Trailhead. Agora você pode acessar o novo formulário de feedback, a qualquer momento, no site Ajuda do Salesforce.

Saiba mais Continue compartilhando feedback