Tips for Building Formulas
Extend your Salesforce data with powerful formula logic. Access a collection of tips for using specific data types in your formulas, including dates, numbers, text, picklists, and record types.
Required Editions
| Available in: both Salesforce Classic and Lightning Experience |
| Available in: All Editions |
- Formulas and Security
Formulas ignore field-level security, which means a formula can inadvertently expose data from referenced fields that you’ve hidden from users. To protect sensitive information, apply field-level security directly to the formula field.
- Picklist and Multi-Select Picklist Formula Fields
Learn about building formulas that reference values from picklist and multi-select picklists. Plus, find guidance on working with boolean checkbox fields and dealing with common errors. See Tips for Working with Picklist and Multi-Select Picklist Values in Formulas.
- Date and Times
Learn how to convert between date and date/time and work with time zones. Plus, find guidance on calculating durations and intervals, and handling fractional values in date calculations. See Tips for Working with Date and Date/Time Formulas.
- Hyperlinks
Learn about using formula fields that contain a
HYPERLINKfunction, including how to control link target behavior and predict how relative and external links open. Plus, find guidance on supported URL protocols in Lightning Experience. See Tips for Using Hyperlinks in Formulas. - Numbers, Currencies, and Percentages
Learn how to work with percent fields using decimal values and how to reference auto-number fields as text. Plus, find guidance on mixing numbers with percentages and currencies, and understanding output limits and rounding behavior. See Tips for Working with Numbers in Formulas.
- Text and Strings
Get tips for working with text in formulas. Find guidance on using quotation marks to insert or concatenate text, escaping special characters with backslashes, and more. See Tips for Working with Text in Formulas.
- Activity Fields
Learn how to create accurate activity formulas by distinguishing between tasks and events. The guidance also covers handling activity-specific fields and correctly referencing polymorphic relationships like Who and What. See Tips for Working with Activity Fields in Formulas.
- Merge Fields
Learn how to reference cross-object merge fields, work with person and business accounts, and more. Plus, find guidance on using a special merge field to reference the unique identifier for your Salesforce org in a formula. See Tips for Using Merge Fields in Formulas.
- Record Types
Learn about applying different workflow rules, validation rules, or lookup filters to different record types. The guidance also covers when to use record type names or IDs in formulas to apply logic based on a record's classification. This topic also covers limiting the use of the record type global variable to default value formulas, and deployment considerations for sandbox and production environments. See Tips for Referencing Record Types in Formulas.

