You are here:
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 |
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.
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.
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)

