You are here:
CASESAFEID
Converts a 15-character ID to a case-insensitive 18-character ID. In Salesforce Classic, the function converts only valid Salesforce 15-character IDs. If you pass in an invalid ID, the function returns the ID passed in. In Lightning Experience, the function converts any 15-character ID.
Use
CASESAFEID(id) and replace
id with the object’s ID.
Tips
- Convert to 18-character IDs for better compatibility with Excel.
- The CASESAFEID function is available everywhere that you can define a formula except reports and s-controls.
- If you’re using Lightning Experience, and you want the function to convert only valid 15-character IDs, contact Salesforce Customer Support to enable this functionality.
CASESAFEID (Id)
This formula replaces the 15-character ID with the 18-character, case-insensitive ID.
CASESAFEID('A01xx000003DHur')returnsA01xx000003DHur. The ID isn’t valid because it begins with a capital letter.CASESAFEID('001xx000003DHur')returns something like001xx000003DHurAAGbecause the ID passed in is valid.

