Every Salesforce record has a unique identifier (Id), which is the one constant characteristic of the record. If you update any field on a record, even the name, Salesforce will still recognize the record based on the Id. The Id is also a key data point in all automated processes and integrations.
There are two Salesforce Record Id formats (15-digit and 18-digit), which are used for different reasons. You may find yourself with the 15-digit Id in Excel, before realizing that you actually need to work with the 18-digit Id to do a VLOOKUP(). This is where Salesforce Id converters come to the rescue!
A Salesforce Id converter is a tool that can turn a 15-digit Id into an 18-digit Id (and vice versa). This guide will cover all possible options for obtaining this data – the pre-built, widely available solutions, as well as how to build your own converter tool.
Differences Between 15-Digit and 18-Digit Ids in Salesforce
|Salesforce 15-Digit Id||Salesforce 18-Digit Id|
|Used by the Salesforce user interface, i.e. what you can paste in the Salesforce URL to open a record, and the standard field you can pull in Salesforce reports.||Used by the Salesforce API because most other platforms do not respect case sensitivity (e.g. they consider ABC the same as abc).
Also present in the URL when opening a Salesforce record.
What are the extra three digits?
The last three digits of an 18-digit Salesforce Id are a checksum of the first 15 characters.
If you’re looking for more information on the parts that form a Salesforce Id, check out this response on the StackExchange.
How to Convert a 15-Digit Id to an 18-Digit in Salesforce
Option 1: Salesforce Formula Field
Salesforce’s official recommendation is to create a formula field to obtain the 18-digit Id and then call it a day. The formula to convert Salesforce Ids (which you might have already encountered in the functions list) is CASESAFEID(Id).
However, there are a few important things to consider:
- The formula field needs to be created as a custom field on all of the Standard and Custom objects you need the 18-digit Id on.
- You need to make sure the field appears on all relevant report types and that view permissions are granted.
- Users need to be trained to use the new field and to modify their existing reports to include it.
- For larger orgs (that have a process in place), the field will need to be built in a sandbox and deployed to production.
Considering the factors above, there are faster and more efficient (as well as more scalable) ways to get the job done if the 18-digit Salesforce Id is required.
Option 2: Build Your Own
While this solution works and doesn’t imply metadata changes to your Salesforce instance, you will always have to copy and paste the Ids you wish to convert.
Note: This may not work in Microsoft Edge.
Option 3: Use an Online Tool
A few bright Trailblazers jumped to fill this gap with online tools (which you can use for free). Here’s how they work: An admin copies and pastes Salesforce Ids into the converter, then copies the results to wherever they are required.
Option 4: Convert Ids in Excel
While online tools are a quick solution for converting multiple Ids all at once, they don’t hit the mark when working with hundreds or even thousands of records in a CSV. or Excel file. Can you imagine the copy and paste nightmare?
That’s why a tool that converts Ids right within the CSV./Excel spreadsheet you’re working from could save you from an admin headache!
XL-Connector by Xappex
As a more robust third-party solution, the XL-Connector (which can be leveraged either in Excel or Google Sheets) raises the bar when it comes to converting Salesforce Ids.
We have all had our fair share of ‘fun’ with Salesforce Ids – finding that you have the wrong Id when doing data management (e.g. record updates in mass) can be very frustrating.
While the manual approach works in most cases, what if we need an 18-character Id in a spreadsheet quickly? And what if we have a sheet with over 1000 rows? In XL-Connector, the conversion is literally one button away.
The Id conversion feature is part of the XL-Connector’s free offering, so a license won’t be needed – simply select all cells containing the Id (without the header), click the button, and voilà!
Retrieve and Update Salesforce Records
The simple fact that you can bulk-convert however many Ids from 15 to 18 characters in a matter of seconds directly in the Excel file is cool enough, but what if you could get them within your file whenever you needed?
The convert Ids function is one of many that the XL-Connector has to offer. If you’re working on a file and find yourself in need of Salesforce data, you can obtain this by querying your Salesforce org – either choose the fields or manually write the SOQL query.
Not only can you get the data you need (in this case the Ids), but you can also update the Salesforce data immediately with new information you have in the spreadsheet. In this simple example, I chose to query the Account Object, get the Id, then update all records with a new Website value.
Considering it can help you get the job done in a single application, the Xappex XL-Connector can become a valuable asset very quickly – there’s no need to use multiple tools.
There will always be times when you need to convert a Salesforce 15-digit Record Id to the 18-digit version, but it’s important to be aware of all possible options to ensure you choose the best one for your use case.
Whether you go with the simple formula field, a browser-based solution, or a third-party option such as Xappex, Ids are not going anywhere anytime soon, and will always be a key factor when manipulating Salesforce data.