Loading
Experience Cloud
Expression-Based Visibility Rules in Enhanced LWR Sites

Expression-Based Visibility Rules in Enhanced LWR Sites

Use Expression-Based Visibility to define when and to whom your components appear in your enhanced LWR sites. Create component visibility rules from the Visibility tab on your components.

Required Editions

Available in: Salesforce Classic and Lightning Experience
Available in: Enterprise, Performance, Unlimited, and Developer Editions
Applies to: LWR sites
Important
Important Visibility rules created during the Spring '23 pilot are no longer functional and must be replaced in future releases.
Note
Note You can also hide or show components based on device type.

For each component you can create a single rule that can contain multiple conditions. Each condition can have up to 5 spans. For example, User.Record.Last Modified By.Contact.Account Name.ShippingCity contains six spans so it isn’t allowed. If you don’t create any rules, the component appears to everyone. Rules are created using AND, OR, or custom logic.

Example
Example

Consider a rule with a Show component state and two conditions using AND logic. One condition says that the User Record City must equal Chicago and the second says that the User Record Title must equal Marketing Manager. The component appears to all users that are in Chicago AND have the title of Marketing Manager. If you changed the logic to OR, the component appears to anyone in Chicago OR anyone with the title of Marketing Manager.

Selectable condition values depend on the type of resource. If you select a field with a predefined list of values, the list is populated in the Value dropdown. If you select an open text field, an open text field is available for the value.

Note
Note Visibility rules aren’t visible from the canvas. From preview mode, user type is evaluated based on the mode, and rules apply if relevant.

Supported Objects, Fields, Field Types, and Operators

The supported objects are User and, in the B2B, B2C, and D2C Commerce templates only, Product. Not all fields are supported for either object.

Component visibility rules rely on the data captured in fields associated with the page’s object. Not all fields, field types, and operators are supported. Supported operators depend on the selected field type.

Supported field types:

  • String type fields: Autonumber, Currency, Email, Number, Percent, Phone, Text, Text Area, URL
  • Checkbox (boolean)
  • Number
  • Picklist
  • Multi picklist

Supported Operators:

  • = and == (Equal)
  • <> or != (Not Equal)
  • > (Greater Than)
  • >= (Greater Than or Equal)
  • < (Less Than)
  • <= (Less Than or Equal)
  • CONTAINS (only available for string, picklist, and multi-picklist fields)
  • NOT CONTAINS (only available for string, picklist, and multi-picklist fields)
 
Loading
Salesforce Help | Article