top of page

Unique Record ID's in Salesforce

Record ID in Salesforce

A Record is collection of data which clearly illustrates the Object. A record can have many fields which stores different types of data related to that object.

A record in Salesforce is a record like in any database. So, an Account Record is the record that has the info about a company, a Contact record is a person, an Opportunity is a deal or transaction etc. Salesforce calls database tables Objects and records are individual instances of those object tables.

Each record in the system has a unique ID field assigned to it which is known as Record ID. It is system generated and cannot be edited or deleted. It is generated every time a new record is inserted into the application.

Salesforce has a multi-tenant architecture and it identifies every record uniquely across all customers by assigning a unique ID to each record. As a Salesforce admin, you need to perform data operations like import/export, write formulas, and reference records using their unique Record IDs.

How do I get record type ID?

How to Find the Record Type ID in Salesforce

  1. Navigate to the Setup menu.

  2. Under Object Manager, select the Object for the Record Type ID you're looking for.

  3. Select Record Types.

  4. Select the Record You're looking to retrieve the ID for.

  5. In the URL, the record type ID is the characters found after “Record Types/”.

Entering a known Record ID in Salesforce can direct you straight to the details page of that record. The first 3 characters of an ID indicate the object type.

For example: Accounts – 001, Contacts – 003, Leads – 00Q, etc.

These prefixes can never be changed for objects. Custom objects are assigned 3-char prefixes based on internal SFDC rules that we cannot predict.

There are two versions of Record IDs:

15 digit case-sensitive version: It is referenced in the user interface.

18 digit case-insensitive version: It is referenced through the API. The last 3 digits of it are the checksum of the capitalization of the first 15 characters.

A 15-digit id can be converted into an 18-digit id using CASESAFEID() function and to convert an 18-digit id into 15-digit simply remove the last 3 digits from it.

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.

For 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.

What is record ID in Salesforce flow?

“Record Id” is a special resource in Salesforce Flows that automatically receives the value of the current record Id. For example, if you want to invoke the flow from an “Action” button on an object, there isn't a way to pass any value to the Flow. In this case if you define a resource of “record Id” in the Flow and mark that as “Available for input”, Salesforce will automatically pass the record Id of the current record to this resource in the Flow. And if you define this resource’s data type as a “Record”, the entire record will be passed to the variable.

Here is an example:

Here is screen flow where I have defined the resource “record Id”. Note that the data type of the resource is “Record” and object is “Account”. The resource has been marked as “Available for input”.

In this screen flow, I have defined a screen component of “Display Text”, that just shows the value of the different fields of the resource defined above. This is to validate that the entire record value is getting passed to the resource “record Id”.

Next, I have defined an “Action” on Account object and calling the screen flow from this action. As you can see, there is no option to pass any value to the screen flow from action.

When I call the screen flow from the “Action” button from an Account record, Salesforce will automatically pass the current record to the “record Id” resource in the flow. This happens automatically behind the scenes. And now, I can see the value of the different fields of the “record Id” variable as defined in the screen flow.

External ID in Salesforce is a custom field that has the “External ID” attribute checked meaning that it contains unique record identifiers from a system outside of Salesforce. When we select this option the import wizard will detect existing records in Salesforce that have the same External Identification.

*Are Salesforce record ids globally unique?

Every record, regardless of entity type, has a globally unique identification value in its ID field which is generated at the time of record creation. That Record ID value will never change, even if the record is deleted and then undeleted.

**While Salesforce Data Loader and other tools such as data importer, can recognize the 15 Digit Id, it is always better to use the 18 Digit Id. It will make sure that any data manipulation you need to do in Excel will work as expected, and that your data load processes cleanly.

***Salesforce Record IDs are identical only in the Full Copy Sandbox and Production environments.

1,590 views0 comments

Recent Posts

See All


Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page