You are currently viewing How Can You Convert 15 Character Salesforce IDs to 18 Character Salesforce IDs?

How Can You Convert 15 Character Salesforce IDs to 18 Character Salesforce IDs?

Data can both empower you or overpower you, depending on how you use it.

Unique IDs help to enrich data and make your life easier.

Let us consider a carpenter’s life.  He has multiple tools, like hack, saw, clamps, tape measure, screwdrivers, etc.

He is all set to go to work, but all these tools are scattered in different rooms.

Don’t you think his productivity will come down in such a case as he will be spending a lot of time simply searching for the required tools?

This is the reason carpenters invest in a toolbox. The toolbox holds all his tools in one place and thus, he can find his tools easily, increasing his productivity.

What are Salesforce Record IDs?

Salesforce host a multi-tenant architecture, identifying all records uniquely by assigning a unique ID to each record. The Salesforce administrators and developers perform multiple data operations, reference records and write formulas using these IDs.

Salesforce record IDs help to identify the records in Salesforce. These record IDs can be 15 or 18 digits.

While the 15-digit Salesforce Record IDs are case-sensitive, the 18-digit ones are not so.

15 Character ID

The 15 character IDs are case sensitive versions referenced in Salesforce user interface. If you want to perform data operations through user interface, you can use these IDs.

18 Character ID

The 18 character IDs are case insensitive versions and they are referenced through APIs. Though the case-insensitive IDs are similar to the case sensitive ones, the 3 extra characters indicate casing of the 15 characters. You need them to use tools like Workbench and Data loader. The API tools accept these 15 character record IDs as input, but you must provide the 18 character record IDs while exporting data. As the 18 character record IDs are case insensitive in nature, Salesforce prefers to use them in formulas, references and APIs.

Conversion of 15 Character Record ID to 18 Character Record ID

To convert a 15 character record ID to 18 character record ID for a record, complete the following steps:

  1. Click Setup > Customise > Object Name > Click Fields

NOTE: For Custom Objects, click Setup > Create > Objects > Object Name

For Lightning Setup, click Setup > Object Manager > Object Name

  • In the Custom Fields and Relationships list, click New.
  • Check Formula.
  • Check Text for Formula Return Type.
  • Enter CASESAFEID(Id) in the Formula Editor.
  • Set the Field Visibility and add or remove it from the page layout.
  • Click Save.

With this simple formula, you can have the 18 character case insensitive formula easily available on Salesforce record and start using it in API and data operations.

The above formula will not work if you are using Excel. If you have several rows in Excel and need to convert the 15 character IDs to 18 character ones, you can use a different formula. For more details, check the Salesforce developer forum.

Leave a Reply