Salesforce’s Geolocation Field is used to identify locations by their latitude and longitude and calculate the distance between them. We can use the geolocation field anywhere the user wants to define a location.
Recently, I worked in a Salesforce company. While working here, I received a task where I needed to enter the office’s defined location under the employee details. This geolocation defines where our office is located. To fulfill this requirement, I used the geolocation Field Type, which is present under the Field and Relationship.
In this Salesforce tutorial, I will explain the geolocation field and how to create a geolocation field in Salesforce Lightning and Classic interfaces.
Geolocation field type in Salesforce
The salesforce geolocation field is defined as a field type that permits the users to identify the location by their latitude and longitude to calculate the distance between the locations.
It is a compound field that adds up org limits as three custom fields: one for latitude, the second for longitude, and the third for internal use. It is not available for external use.
Now, let’s move further and see how to create the geolocation field type in Salesforce Lightning and Salesforce Classic.
Read How to Create Date Time Field Type in Salesforce
How to create a geolocation field type in Salesforce Lightning
Here we are creating the geolocation field type in Salesforce Lightning.
Here, we are taking an example: we are using the Business Brand object inside the Business Brand object. We want to add the Office Location as a geolocation field.
There is a Cisco company in the USA. In this company, many employees work. There is a need to add the office’s location under all the employees’ details section, which defines the location of the office. This office location is added by simply using the geolocation data type, which is present under the Field and Relationship.
Here are the following steps:
1. Go to the Gear icon –> Click on the Setup option –> Select the Object Manager tab.

2. Enter the Business Brand in the search box. Click on the business brand object.

3. Select the Fields and Relationships option that is present under the details section.

4. Here, we want to create a new field. So, for this, click on the New button.

5. Here, we are selecting the Geolocation field Checkbox. The geolocation field type is defined as a field type that permits the users to identify the locations. Click on the Next button.

6. Now enter the details. First, fill the Field Label as Office Location and then fill the Decimal Places as 10. After that, fill the Field Name by simply clicking on it. Click on the next button.

7. Now establish the field-level security. Select the profiles to which we want to grant edit access to this field via field-level security. If we do not add field-level security, the field will be hidden from all profiles. Click on the next button.

8. Now, add the custom field to the page layout. Select the page layout that should include this field. Click on the Save button.

9. Go to the app launcher and enter sales in the search box. Select sales, the sales page is open and then select the Business Brand object.
The Business Brand record page is open. Here, you can see a details section. Under this section, we can see that the geolocation field type is created, and we can enter the Office Location related to the Office Location column in the geolocation field.

This way, we understand how to create the geolocation field type in Salesforce Lightning. Let’s Proceed further and learn how to create the geolocation field type in Salesforce Classic.
Read How to Create Email Field Type in Salesforce
How to create a geolocation field type in Salesforce Classic
Here we are creating the geolocation field type in Salesforce Classic. Here, we are taking an example: we are using the Business Brand object inside the Business Brand object. We want to add the Offline Location field as a geolocation field.
Here are the following steps:
1. Login into the Salesforce account –> Click on the Profile Picture –> Click on the Switch to Salesforce Classic option –> Select the Setup option.

2. Enter the Accounts object in the Quick Find Box. Click on the accounts drop-down arrow. Our accounts drop-down list is open. Select the Fields option.

3. Here, we want to create a new field. So, for this, click on the new button.

4. Here, we select the Geolocation checkbox field and click on the next button.

5. Now enter the details. First, fill in the Field Label as Customer Location and then fill in the Decimal Places as 10. After that, click on the field name to fill it in. Then, click on the next button.

6. Now establish the field-level security. Select the profiles to which we want to grant edit access to this field via field-level security. If we do not add field-level security, the field will be hidden from all profiles. Click on the next button.

7. Now, add the custom field to the page layout. Select the layout that should include this field, and click the save button.

Conclusion
I hope you understand how to create a geolocation field in Salesforce. I have also explained step by step how to create the geolocation field type in Salesforce Lightning and Salesforce Classic.
You may also like:
- Create a Custom Lightning Record Page in Salesforce
- Create Number Field Type in Salesforce
- Create a Phone Field Type in Salesforce
- How to Set the Latitude and Longitude Display Notation for Geolocation Field in Salesforce
- How to Set Decimal Place for Geolocation Field in Salesforce
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.