Formula fields in Salesforce are read-only fields that automatically calculate values based on other fields or expressions. To combine data, you typically use the Concatenation operator.
Step 1: Creating a Formula Field
- Navigate to Setup > Object Manager.
- Select your Object and click Fields & Relationships.
- Click New.
- Select Formula as the Data Type and click Next.
- Enter a Field Label (e.g., Full Name or Shipping Address Summary).
- Select the Formula Return Type. For combining text, choose Text.
Step 2: Combining Text Fields (Concatenation)
The ampersand symbol (&) is used to join different pieces of data together.
Basic Syntax:
Field_1__c & ” ” & Field_2__c
Example: Creating a “Full Name” from First and Last Name
To ensure there is a space between the names, you must include a space within quotation marks:
FirstName & ” ” & LastName
Step 3: Handling Different Data Types
If you are combining a text field with a non-text field (like a Date or a Number), you must convert the non-text field first using functions.
Goal | Formula Function | Example |
Date to Text | TEXT() | “Created on: ” & TEXT(CreatedDate) |
Number to Text | TEXT() | “Serial #” & TEXT(Unit_Number__c) |
Picklist to Text | TEXT() | “Status: ” & TEXT(Status) |
Step 4: Advanced Combining: Using BR() for Line Breaks
If you want to combine data into a block (like an address), use the BR() function to force a new line.
Example: Formatting a Shipping Label
Street_Address__c & BR() & City__c & “, ” & State__c & ” ” & Zip_Code__c
Step 5: Best Practices for Technical Guides
- Check for Nulls: If one field in a formula is empty, the entire formula might appear blank depending on your settings. Use BLANKVALUE() to provide a fallback:
- BLANKVALUE(MiddleName, “”) & ” ” & LastName
- Character Limits: Formula fields have a limit of 3,900 characters for the compiled logic.
- Cross-Object Formulas: Remind users they can pull data from a “Parent” record into a “Child” record (e.g., showing the Account’s Industry on a Contact record).

Salesforce

