Loading
Salesforce Enforces New Security Requirements in Summer 2026Read More
Extend Salesforce with Clicks, Not Code
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          RIGHT

          RIGHT

          Returns the specified number of characters from the end of a text string.

          Use

          RIGHT(text, num_chars) and replace text with the field or expression you want returned; replace num_chars with the number of characters from the right you want returned.

          Tips

          • Reference auto-number fields as text fields in formulas.
          • If the num_chars value is less than zero, Salesforce replaces the value with zero.
          Formula Example
          Formula Example TRIM(LEFT(LastName, 5))&"-"&TRIM(RIGHT(SSN__c, 4)) displays the first five characters of a name and the last four characters of a social security number separated by a dash. Note that this formula assumes you have a text custom field called SSN
           
          Loading
          Salesforce Help | Article