Download the Loqate app from the Salesforce AppExchange
Available services
The Loqate app gives you access to these Loqate services in your Salesforce CRM instance:- Address Capture, which provides a type-ahead solution for address input - referred to in Salesforce as Address finder
- Email Validation, which ensures the accuracy of customer email addresses - referred to in Salesforce as Email validator
- Phone Validation, which ensures the accuracy of customer phone numbers - referred to in Salesforce as Phone number validator
Use cases
There are two ways of using Loqate services in your Salesforce instance:- On record pages, using Lightning components - all Loqate services
- During actions, using Flows (recommended) or Visualforce components (legacy, and not recommended) - Address Capture only
Prerequisites
Before installing the Loqate app you will need:- A live Salesforce CRM account
- A live Loqate account
- A Loqate API key*
Process
There are a few quick steps to get the Loqate app up and running:- Install the app
- Assign permissions
- Add your Loqate API key
- Set up address mappings
- Add Loqate widgets to your object pages
- Optional: Address finder settings
- Add address Capture to Flows
Installing the Loqate app
We recommend installing the Loqate app directly from the Salesforce AppExchange - adding the app from here will ensure you’re always installing the latest version.Setting permissions
The Loqate app includes two permission sets: Loqate Administrator and Loqate User. The use cases for these sets are as follows:- Loqate User: for any users who need to use the Loqate controls on the page to validate addresses, email addresses and/or phone numbers, but don’t need to administer the settings of the app itself
- Loqate Administrator: for users who need to administer settings and mappings for the app, as well as use the controls as per the Loqate User permission set

App setup
With the app installed and permission sets assigned, the next step is to add your Loqate API key to the app, which you can do in the API Settings section of the Loqate Settings page.
Address mappings
For each address type that you want to populate using the Address finder control, you need to create an address mapping. This may involve creating multiple mappings for a single object - for example, for the Contact object you might create one mapping for the ‘Mailing’ address and another for the ‘Other’ address. You can create address mappings in the Settings page of the Loqate app.- In the Mappings section, click New Mapping
- Name your mapping (we recommend using a distinct and memorable name, to distinguish it from other address types - for example, “Contact Mailing”)
- From the ‘Select an object’ drop-down, choose the object that you want to create a mapping for

- Click the + Add Field button, then from the ‘Select a field’ drop-down choose a field that you want to populate with address data
- From the ‘Select a element’ drop-down, choose a Loqate element to map to your chosen field

- Click the Add Field Mapping button to save and add your new mapping to the list

Custom mappings
If required, you can also use custom address mappings.- When selecting an element to map to a field, choose the custom format option option from the drop-down list
- In the ‘Custom pattern’ field that appears, enter your custom field mapping
- For example, entering ”, will concatenate line1 and line2, separated by a comma and a space (assuming line2 is available - if not, only line1 will be included)

- See the Formatting section of our Advanced Setup Guide for more information about custom field values
Loqate widgets
In order to start using Loqate functionality, you need to add each control (i.e. Address finder, Email validator and Phone validator, where appropriate) to your object pages.- From the Details tab on the Contacts page, select Settings and then Edit Page

- In the Lightning App Builder, look for the Loqate controls in the Custom section of the Components menu. You should see
loqateAddressCapture
,loqateEmailVerification
andloqatePhoneVerification
:

- You can drag each of these onto your page, placing them where you want them. Here’s an example showing all three components added to the right-hand side of the page:

- Once you’ve placed all of the components, Save and Activate the page to be able to start using them
- Repeat this process for all pages that you want to add the Loqate features to
Optional: Address finder settings
The Address finder control includes some additional settings which you can amend if required. To see these settings, select an Address finder control where it’s been added to one of your pages.
Field mappings
By default, the Address finder control will display a select box listing all of the mappings you’ve created for the object on which the control has been placed. You can then select the relevant mapping you want to use. Optionally though, you can lock the Address finder control to a particular mapping by entering a specific mapping name in the Field Mappings box. The control will no longer display the ‘Select a mapping’ box, and will instead always use the mapping you’ve chosen.Address title prefix
If you have multiple Address finder controls on a single page (for example if you’ve locked one or more of them to particular mappings), it’s useful to give each one a specific name to clearly differentiate them. You can use this setting to add additional text to the start of each control’s title. Whatever text you enter in the Address Title Prefix box will be added at the start of its title - so for example if you have both ‘mailing’ and ‘other’ address fields on a page, add “Mailing” into this box for one of the controls so that it will display as “Mailing Address finder”.Add Address Capture to Flows
Follow these steps to add Address Capture to a Flow:- Open the Flow editor for the Flow you want to add Address Capture to. For this example we’ll use Create a case

- From here, choose a screen to add the Loqate control to, and open the screen editor. In this example we’ll use the Confirm Customer Info screen

- The Loqate Address Capture component will be listed under Custom, so scroll down to that and drag the component onto your view

- Make sure you add a name into the API Name field
- You shouldn’t need to fill in any of the other fields, as they’re in place to allow for the Flows data model
- Click Done, then run or debug the Flow to view the control and output

- From here you can see that the Search for an address field is present
- Having searched for and found an address, click Next to move to the next screen - in this case the Confirm Customer Details screen

- Here you can see the returned address data, which you can then use in the rest of the Flow
Handling Custom Field Types in Flows
When using the Loqate Flow action to return custom fields, the output values are returned as Text. This is fine for most scenarios, but can cause issues when mapping onto Salesforce standard fields that expect other data types (for example,MailingLatitude
and MailingLongitude
, which are Number fields).
If you attempt to map a Text resource directly to a Number field in a Create or Update Records element, Flow will block the mapping.
Solution: Use a Number Formula Resource
You can convert the returned Text into a Number inside your Flow before mapping.
Steps:
- In Flow Builder, open the Manager panel and click New Resource.
-
Select Resource Type:
Formula
. -
Give it an API Name (e.g.
latNumber
). -
Set Data Type:
Number
. -
Set Decimal Places:
6
(or another precision suitable for coordinates). -
Enter the following formula, referencing the Text output from the Loqate action (e.g.
selectedAddressField1
):
-
VALUE()
casts the text into a number. - Blank or invalid inputs return NULL so the Flow won’t fault.
- Save the resource.
-
In your Create/Update Records element, set the record field (e.g.
MailingLatitude
) to this formula resource.
-
Loqate selectedAddressField1 →
"52.123456"
(Text) -
Formula (latNumber) →
52.123456
(Number) - Mapped to Contact.MailingLatitude → works successfully.
In use
With the Loqate app installed and configured, you can start using the Address finder, Email validator and Phone number validator controls when inputting addresses, email addresses and phone numbers into Salesforce. For example, here’s how the Address finder control looks during an address search:
Legacy Visualforce elements
In some cases you may want to use a more legacy approach to including Address Capture in your Salesforce instance, for example by overriding the New button action on a record listing page. In the following examples we’ll use the standard Contact record type to demonstrate the use of the included legacy Visualforce component. The Loqate app ships with a Visualforce page that can be used to replace the New button action via Object Manager, and is a reference build for the outcome of this example.Building the page
In this example we will be creating a new page to replace the standard Contact Create page and allow for Address Capture to be used in that process. Please note that this is a legacy approach, and we would recommend you use Flow views for this kind of action.
legacyLoqateAddressCapture
Visualforce component.
The full Visualforce page looks like this:
Attribute name | Description | Example |
---|---|---|
label | This is the label for the control, and will appear alongside the control input box on pages. | Mailing Address |
namespace | Optional. This attribute is important when you have multiple controls on a single page, as this allows the controls to operate independently of each other. It must be unique across rendered controls. | mailing |
onAddressSelectedFunction | This should be set to the name of the callback function that selected addresses will be returned to. | handleMailingAddressSelected |
Mapping | Optional. If a mapping group name is provided, the second argument passed to the callback function will be an object whose keys and values are those of the mapped fields. | Contact Mailing |
Using the page in place of the standard New view
With a Visualforce page in place that uses the Address Capture components, you now need to override the default behaviour of the New button on the contact listing page. This is achieved through the Object Manager, so navigate to Setup and search for Object Manager. Once there, select Contact from the list.
