Considerations for Conditional Field Formatting in Lightning App Builder

Keep these considerations in mind when configuring conditional formatting for fields on Dynamic Forms-enabled record pages in the Lightning App Builder.

Required Editions

Lightning App Builder available in: Salesforce Classic (not available in all orgs) and Lightning Experience
Lightning pages and Dynamic Forms available in: Lightning Experience and the Salesforce mobile app

Available in: Group Essentials, Professional, Enterprise, Performance, Unlimited, and Developer Editions

Considerations

  • You can apply conditional formatting only to fields on objects that support Dynamic Forms. Dynamic Forms is supported for most but not all standard Lightning web component (LWC)-enabled objects. See LWC Migration for Record Home Pages for a list of LWC-enabled objects. If you open a record page for an object in the Lightning App Builder and don’t see a Fields tab in the component panel, then Dynamic Forms and conditional formatting aren’t supported for that object. For example, the Note object doesn’t support Dynamic Forms because it has a fixed layout. In addition, the Campaigns, Products, and Tasks objects, which aren’t LWC-enabled, use information from page layouts and therefore don’t support Dynamic Forms or conditional formatting.
  • We recommend that you add no more than 15 unique rulesets to a Lightning page.
  • The icons available for conditional formatting come from the Lightning Design System. If you don’t see a specific icon in the icon picker, then it’s not supported for conditional field formatting.
  • If you apply conditional formatting to a field, but it doesn’t appear when the page displays at run time, then conditional formatting isn’t supported for that field.
  • Conditional formatting rules can evaluate differently at run time, depending on the permissions of the user viewing the record page.

    For example, let’s say that you have fields A, B, C, and D, and a user only has permission to see fields A and B. The user goes to a page that contains field A, which has conditional formatting configured for it with two rules. The first rule has conditions based on fields C and D, which the user doesn’t have permission to view. The second rule has conditions based on field B, which the user does have permission to view.

    Because the user doesn’t have permissions for fields C and D, the first rule could evaluate to true or false, but the user can’t know the outcome because they can’t see those fields. However, because they can see field B, they can see the outcome of the conditions of the second rule. In this case, Salesforce ignores the outcome of the first rule and delivers conditional formatting to the user based only on the outcome of the second rule, because the conditions for that rule are based on a field they have permission to view field B.

    Therefore, it’s possible that the user in this example sees a different result for conditional formatting than their colleagues who have access to fields C and D.

  • Conditional formatting rules evaluate based on the raw value of a number, not its rounded up display value.
  • Conditional field formatting rules treat blank (null) values on numerical fields as zero values.
  • Conditional formatting rulesets aren't automatically included when you add a Lightning page to a change set. If you create an outbound change set with a Lightning page that contains conditional formatting, make sure to add all of the page's conditional formatting rulesets to the change set. Conditional formatting rulesets are listed as "UI Format Specification Set" in the change set Component Type dropdown.

Limitations

  • A ruleset can have up to 10 rules.
  • A rule can have up to 10 conditions. If you don’t specify any conditions, the rule always applies.
  • You can’t add conditional formatting to cross-object fields, nor can you select cross-object fields when creating rules.