Conditional Field Formatting to Visually Highlight Fields for Quick Attention

Conditional Field Formatting to Visually Highlight Fields for Quick Attention

Last Updated on March 10, 2025 by Rakesh Gupta

Big Idea or Enduring Question:

  • How can conditional formatting in Salesforce Lightning App Builder enhance data visibility and user productivity by dynamically highlighting critical information?

Objectives:

After reading this blog, you’ll be able to:

  1. Understand Conditional Field Formatting in Salesforce.
  2. Configure a Dynamic Highlight Panel in Lightning App Builder.
  3. Apply rules to highlight key field values.
  4. Improve data visibility and user experience.
  5. Delete a Conditional Field Formatting. 

Business Use case

Emma Johnson, a Salesforce Administrator at Gurukul on Cloud (GoC), recently discovered the Conditional Field Formatting feature while reviewing the release notes. Excited to enhance data visibility, she decided to implement it for the Account Rating field (on highlight panel) with the following rules:

  1. Cold → Display a Red Warning Triangle icon with the word Cold.
  2. Hot → Display a Green Rocket icon with the word Hot.
  3. Warm → Display an Orange Smiling Face icon with the word Warm.

Pre-requisites:

Before implementing Conditional Field Formatting, keep these important points in mind:

  1. Conditional Field Formatting is only available for fields enabled through Dynamic Forms.
  2. To use Conditional Field Formatting in the Highlights Panel, you must use a Dynamic Highlight Panel.

If you haven’t enabled Dynamic Forms or the Dynamic Highlight Panel, take a moment to complete the relevant Trailhead modules to set them up before proceeding.

If you’re using Salesforce Mobile and want these indicators to appear on mobile devices, you must enable Dynamic Forms on Mobile. 

Traditional Method: Using Formula Fields

Previously, the standard way to display icons based on field values was through Formula Fields. This required creating a formula field that referenced an image formula, with images either stored in Static Resources or hosted externally on the web.

While this method worked, it involved extra effort – managing image URLs, maintaining formulas, and ensuring proper rendering – just to display a simple icon. Moreover, this approach required creating an additional field solely to meet a business requirement, adding unnecessary complexity for administrators and developers.

Modern Approach: Conditional Field Formatting

Conditional Field Formatting in Salesforce Lightning App Builder allows you to visually enhance fields on record pages based on specific conditions. You can apply icons, colors, and text styles to make important data stand out, improving readability and decision-making.

For example, instead of a plain Priority field on a Case record, you can use Conditional Field Formatting to display:

  • 🟢 Green for Low priority
  • 🟡 Yellow for Medium priority
  • đź”´ Red for High priority

How Conditional Field Formatting Works

Conditional Field Formatting is available on Dynamic Forms-enabled pages and operates through rulesets – a collection of conditions that determine when and how formatting is applied to a field. These rulesets allow you to define specific criteria based on field values, formulas, or related records, ensuring that important information is visually distinct.

With this approach, users don’t need to rely on reading field values manually – instead, they can quickly interpret the status through visual cues, improving efficiency and decision-making.

Benefits of Conditional Field Formatting

Conditional Field Formatting makes key data stand out, ensuring users can quickly interpret and act on critical information. Here are the benefits:

  1. Better Data Visibility: Important information is easier to identify at a glance, reducing the need to search through records manually.
  2. Increased Productivity: Users can quickly assess key details without scanning multiple fields, allowing for faster decision-making and improved workflow efficiency.
  3. Flexible Customization: Formatting dynamically adapts based on field values, ensuring the most relevant information stands out when needed. Whether it’s highlighting urgent cases, flagging high-value opportunities, or marking overdue tasks, this feature provides a tailored, intuitive user experience.

Automation Champion Approach (I-do):

To address Emma’s business use case, we will use Conditional Field Formatting. Before proceeding, ensure that Dynamic Forms is enabled for the Account object, as this use case specifically applies to Account records.

Step 1: Create a Ruleset

In this step, we will create a ruleset for the Account Rating field in the Dynamic Highlight Panel. Follow the steps below to complete this process:

  1. Navigate to Setup | Object Manager | Account | Lightning Record Pages.
  2. Select the Lightning Record Page for Account and click Edit.
  3. Click on the Rating field in the Dynamic Highlight Panel.
  4. Navigate to the Conditional Formatting section in the right-side panel.
  5. Click Create Ruleset to start defining the formatting rules.
  6. Enter a Rule Name, then click Next to proceed.

Now that the ruleset is created, we can proceed to defining the formatting rules in the next step.

Step 2: Define Formatting Rules

In this step, we will add conditions to determine how the Rating field should appear when its value is Cold. Follow the steps below to configure the formatting:

  1. In the Ruleset Editor, choose the formatting options:
    1. Icon: Warning Triangle
    2. Icon Color: Red
  2. Set the condition:
    1. Field: Rating
    2. Operator: Equals
    3. Value: Cold
  3. click Next to proceed.

Repeat the above steps for Hot and Warm ratings as per the business use case:

  • If Rating = Hot → Display a Green Rocket icon with the text Hot.
  • If Rating = Warm → Display an Orange Smiling Face icon with the text Warm.

At the end of this step, the Ruleset for the Rating field in the Dynamic Highlight Panel will look like below screenshot: 

Step 3: Save and Activate the Page

Now that the Conditional Formatting Ruleset is configured, follow these final steps to apply the changes:

  1. Click Save Ruleset to save your updates.
  2. Activate the Lightning RecordPage to ensure all users can see the updated formatting on the Account Rating field.

Once activated, the Dynamic Highlight Panel will now visually differentiate Cold, Warm, and Hot ratings, enhancing data clarity and user experience.

Steps 4: How to Delete Conditional Field Formatting in Salesforce

If you no longer need Conditional Field Formatting on a field, you can easily remove it through Lightning App Builder. Deleting a Ruleset will remove all applied formatting, such as icons, colors, and text styles, restoring the field to its default appearance. Follow the steps below to delete Conditional Field Formatting from a field.

  1. Navigate to Setup | Object Manager | Account | Conditional Field Formatting.
  2. Locate the Ruleset by its name.
  3. Click the dropdown on the right-hand side of the Ruleset.
  4. Select Delete from the dropdown menu.
  5. Click Delete to confirm the removal.

Things to Remember

  1. Formatting can be based on other field values, not just the selected field.
  2. Only predefined icons are available; custom icons cannot be added.
  3. A field can have only one ruleset, but multiple rules within it.
  4. Rules execute in order – once a rule evaluates as TRUE, remaining rules are ignored.
  5. Conditional Formatting rulesets must be manually added to Change Sets for deployment.
  6. If a Ruleset is referenced in a field, you will not be able to delete Conditional Field Formatting.

Formative Assessment:

I want to hear from you!

What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? Feel free to share in the comments below.

Go back

Your message has been sent

Warning
Warning
Warning
Warning
Warning

Warning.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.