Conditional formatting is a fun, new feature in Salesforce that allows users to visually distinguish key data points on record pages. By applying rulesets to fields, you can enhance data visibility, streamline workflows, and enable faster decision-making.
This article explores what conditional formatting for Salesforce fields entails and provides a detailed tutorial on setting it up for a practical use case.
What Is Conditional Formatting for Salesforce Fields?
Conditional formatting for Salesforce fields is a feature in the Lightning App Builder that allows you to customize the appearance of fields on record pages based on specific conditions.
This customization can involve adding icons, colors, or text styles to make critical data stand out. The feature works with Dynamic Forms-enabled pages and is managed through rulesets – collections of conditions that control when and how formatting is applied.
Key benefits include:
- Enhanced data visibility: Highlight crucial data to ensure it’s easy to find.
- Improved productivity: Help users quickly identify important information.
- Dynamic customization: Use flexible conditions based on field values or related criteria.
Whether it’s highlighting urgent tasks or flagging high-value opportunities, conditional formatting helps your team make informed decisions faster.
How to Set Up Conditional Formatting
In this tutorial, we’ll walk through how to configure conditional formatting for a specific use case: displaying a smiling face, neutral face, or sad face based on the Amount field. The formatting will:
- Show a red sad face if the amount is under $10,000.
- Show an orange neutral face if the amount is between $10,000 and $99,999.
- Show a green happy face if the amount exceeds $100,000.
Prerequisites:
- A Salesforce environment with Lightning App Builder enabled.
- A record page that supports Dynamic Forms.
Step 1: Open Lightning App Builder
- Navigate to Setup in Salesforce.
- Search for App Builder in the Quick Find box.
- Open the Lightning App Builder and select the record page you want to customize.
Step 2: Add Conditional Formatting
- Click on the Amount field on the page layout canvas.
- In the property panel on the right, locate the Conditional Formatting section.
- Click into the box that says Select a ruleset and + Create Ruleset to create a new ruleset.
- Give your ruleset a name.

Step 3: Define Your Rules
- Create Rule 1:
- Action: Choose the sad face icon and change the color to red to highlight the field.
- Condition: Set Amount LESS THAN 10,000.
- Click Next.
- Click + Add Rule.
- Create Rule 2:
- Action: Choose the neutral face icon and change the color to orange to highlight the field.
- Condition: Set Amount GREATER THAN OR EQUAL 10,000 and Amount LESS THAN OR EQUAL 99,999.
- Click Next.
- Click + Add Rule.

- Create Rule 3:
- Action: Choose the happy face icon and change the color to green to highlight the field.
- Condition: Set Amount GREATER THAN OR EQUAL 100,000.
- Click Next.
- Click Save Ruleset.
Step 4: Save and Activate
- After configuring the ruleset, click Save to store your changes.
- Activate the record page layout if it isn’t already active.
Step 5: Test Your Formatting
- Go to a record that uses the field you applied conditional formatting to.
- Adjust the Amount field value to see the conditional formatting in action.
Top Tips
- You choose the field to apply conditional formatting to (in the example above, the Amount field) but your formatting rules can use the value of other fields. So, if I am adding conditional formatting to the Amount field, my conditions could be based on another field value such as the Close Date or Stage.
- You must choose from the list of icons. You cannot add your own which is a bit disappointing. Originally I wanted to create conditional formatting to show 1, 2, or 3 dollar signs depending on the amount, but this was not possible.
- You can add multiple conditions and logic, including custom logic such as 1 AND 2 AND (3 OR 4).

- A field can only have one ruleset at one time but many rules. Rules are executed in the order you create them and as soon as a rule evaluates to TRUE, all remaining rules are ignored. You can’t reorder your rules after creation so be sure to add them in the right order.
- You have to edit the individual rule to delete it.

- You can have up to 10 rules per ruleset.
- You can delete an entire ruleset from Conditional Field Formatting on the object.

Best Practices for Conditional Formatting
- Keep it simple: Avoid overloading pages with too many visual cues to maintain clarity.
- Test extensively: Check formatting under various conditions to ensure accuracy.
- Collaborate: Work with stakeholders to define meaningful rules that enhance usability.
Considerations for Conditional Formatting
- Edit: You can edit your configured rulesets.
- Delete: You can delete your configured rulesets.
- Rename: The ability to rename a ruleset is not yet available, but it is on the roadmap.
- Dynamic Forms: This functionality is only available for Lightning Experience-enabled orgs and on a record page that supports Dynamic Forms.
Summary
Conditional formatting for Salesforce fields transforms static record pages into visually exciting, user-friendly interfaces. Following this tutorial, you can easily set up rules that highlight critical data and make Salesforce a more intuitive tool for your users.
What use cases do you have for conditional formatting for fields in your org? Let us know in the comments!
Comments: