Convert a 15-digit Salesforce ID to an 18-digit ID
When working with data inside Salesforce, the standard 15-digit ID is treated as a unique ID. However, when you run a report and export it into Excel, the uniqueness of the ID is lost because Excel is not case-sensitive.
Below is an example:
Salesforce sees these two IDs as unique values. Excel does not.
Record 1: 0011r00002M1AOO
Record 2: 0011r00002m1aOO
If you are going to do any data work outside of Salesforce using the IDs, you should use the 18-digit ID instead of the 15-digit ID. The last three characters on the end of the 18-digit ID will make it unique to Excel or any other system that will not treat the 15-digit ID as case-sensitive.
There are several ways to obtain the 18-digit ID without using code.
Admin Booster is an awesome website that lets you copy Salesforce IDs into the web page and return the 18-digit value for each ID. We have personally converted 10,000+ ID’s using this tool and it has yet to fail.
The website is https://www.adminbooster.com/tool/15to18
a. Copy your 15-digit IDs into the box on the right
NOTE: If you’re using Windows, when you copy the data your cursor will be sitting on a line with no values. You will need to hit the backspace key before moving onto the next step. Otherwise, you will receive the following error: “ID has not a length of 15 characters 18”.
b. Click the 15=>18 button
c.Voila! The 18-digit equivalent will appear in the box to the right. d. Copy and paste the IDs into a new column in your spreadsheet and now you have both the 15 and 18-digit IDs.
If you know you will frequently need to do data work outside of Salesforce, it makes sense to create a field that contains the 18-digit ID. Creating a field allows you to pull reports with the 18-digit ID already present. This lets you begin your data work immediately instead of using a site like Admin Booster to generate the 18-digit IDs.
a. Go to Setup > Click Object Manager Tab > Click the name of the object where you want to create the 18-digit ID
b. Click Fields & Relationships > Click New Button in upper right-hand corner of the page
a. Go to Setup > Under App Setup click Customize
b. Click on the name of the object where you want to create the 18-digit ID
c.Click on Fields
d. Click the New button under the Custom Fields & Relationships section of the page
Then follow the steps below:
1. Select the Formula Data Type and click Next
2. Name your field
Example: Account ID (18)
NOTE: Our recommendation is to name it the object name followed by ID and then put the number 18 in parenthesis
The reason we recommend this naming convention is because there is already a standard Salesforce field named Account ID. You should distinguish this custom field so there is no confusion why there are two Account ID fields when you’re pulling reports.
3. Select Text as the formula return type
4. Click on the Advanced Formula tab and then click then Insert Field button
5. Select the ID field that you want to use
6. Place CASESAFEID in front of the ID field and put the text “Id” in parenthesis like shown below and click Next
7. Set field level security for your new formula field and click Next.
NOTE: We recommend that the field is visible to all internal users so they will be able to see the field when pulling reports.
8. Determine if the field should be seen on your page layouts and click Save
NOTE: We recommend that this field is not added to the page layout unless users need to see the field for a business purpose. Keeping page layouts streamlined is important to limit user confusion.
This will automatically return the 18-digit ID in Salesforce.
Have an interesting Salesforce challenge you’d like us to solve? Contact Us