Setting Up the 'Nearby' Lightning Component

Geopointe includes a 'Nearby' Lightning Component that can be configured to show users an instant snapshot of nearby records right from a record page (in Lightning) or the Salesforce mobile app, without navigating to the Map. The component can be configured to reference any filtered or unfiltered data set, supporting a multitude of applications. It can also be added to Community pages.

How it Works

If deployed to a Lightning page layout, the Nearby component will use that record's location as the reference point for the nearby records displayed. In Salesforce Mobile App, it will use the mobile user's current location as the center of the search. 

This component could be configured to show any filtered of unfiltered data set, such as nearby active accounts, hot leads, customers, delivery centers, or any other mapped Salesforce object. 

Setting Up the Nearby Component

Check out this video overview of the configuration process, or follow the steps below.

For this example setup, we will be configuring the component to display Nearby Accounts with Opportunities on Account record pages.

1. Create a data set with the types of records that you want to display. We recommend that you save the data set in a folder that is only accessible to admins.

2. Edit the data set, navigate to the Other tab, and copy the unique ID number to your clipboard so you can reference it later.

3. In Setup, navigate to the Lightning App Builder page (under Build in the Classic Interface, or User Interface in Lightning Experience).   

4. Click New to create a new layout, or Edit if you want to add the component to an existing Lightning page. 

5. Choose a type of layout. Because we are adding the component to Account record pages, we created a Record Page layout with Account as the object. If you want to deploy this feature to the Salesforce Mobile App to show records nearby the user's current location, create an App Page layout. If you want to add the component to your Salesforce Home page, choose Home Page

6. Choose the template you prefer, then click Finish.

7. In the Lightning components menu, under the Custom - Managed section, click and drag Geopointe - Nearby List to any section of the page layout editor.

Note: If the component is not available, you may see a message from Salesforce that you need to deploy a custom domain in order to access Lightning components. Follow Salesforce’s guidance to deploy the domain, then continue with these steps.

8. Enter the Data Set ID that you copied from the data set. 

7. Complete the remaining fields as follows:
Component Label: Label displayed at the top of the nearby list component. In this example, we changed it to “Nearby Accounts with Opportunities.”
Units: Units can be either miles or kilometers and are used for distance calculations.
Max Range: The maximum limit on nearby search radius.
Record Limit: The maximum limit on total records found from the search.
Number of Fields to Display: The maximum number of configured fields to display with each record.
Only Show High Quality Geocodes: Filters out low quality geocodes to only show high quality results. This includes geocodes with ROOFTOP, RANGE_INTERPOLATED, or CUSTOM in the Geocode Quality field. 

8. Click Save.

Note: Make sure your Lightning page is assigned to the apps, profiles, and record types where you want it to appear. You can review and adjust these settings by clicking the Activation button.

9. Check your work by navigating to a record page that uses the layout you just configured, or by refreshing the Salesforce Mobile App and tapping the custom app you just created. In this example, the Trade Wind Inflatables account record page is displaying five of the closest opportunities within 25 miles of it's location:

Salesforce Mobile App

If deployed as an App page, the Lightning component will be available in the Apps section of the Salesforce mobile app menu. Tapping the app will launch nearby record based on your current location:

Adding Additional Fields

If you want to make the Nearby component even more powerful for your users, you can add fields to display additional data in the list. Check out this video with more tips on the process: