Loading
Salesforce Enforces New Security Requirements in Summer 2026Read More
Extend Salesforce with Clicks, Not Code
LEFT

LEFT

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

Use

LEFT(text, num_chars) and replace text with the field or expression you want returned; replace num_chars with the number of characters from the left 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.
Custom Field Example
Custom Field Example

TRIM(LEFT(LastName, 5)) & "-" & TRIM(RIGHT(SSN__c, 4))

This formula 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 example uses a text custom field called SSN.

 
Loading
Salesforce Help | Article