---
schema_version: "1"
id: 80fda4e4ffe95174571542afbd26d69df193c914ee3ec992802eb117df8a2f0e
title: Expression-Based Visibility Rules in Enhanced LWR Sites
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/experience/264-0-0/exp_cloud_expression_based_visibility_rules.md
canonical_url: https://help.salesforce.com/s/articleView?id=experience.exp_cloud_expression_based_visibility_rules.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 5c219e83804fac576ac7acfc067c84b6f1acea96ed7665305c0b874881fb89f0
description: 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.
products:
  - Experiences
release: "264"
---
# 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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Applies to: <a href="https://help.salesforce.com/s/articleView?id=experience.exp_cloud_basics_glossary.htm&amp;type=5&amp;language=en_US" target="_blank">LWR sites</a></td></tr></tbody></table>

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-experience-communities-264-0-0-production-enus/bf7df212-91a1-4fa3-a007-4d6f3e3b470b/images/icon_important.png)

Important Visibility rules created during the Spring '23 pilot are no longer functional and must be replaced in future releases.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-experience-communities-264-0-0-production-enus/bf7df212-91a1-4fa3-a007-4d6f3e3b470b/images/icon_note.png)

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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-experience-communities-264-0-0-production-enus/bf7df212-91a1-4fa3-a007-4d6f3e3b470b/images/icon_example.png)

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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-experience-communities-264-0-0-production-enus/bf7df212-91a1-4fa3-a007-4d6f3e3b470b/images/icon_note.png)

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)

#### See Also

- [Show or Hide Components on Mobile, Tablet, or Desktop for Enhanced LWR Sites](https://help.salesforce.com/s/articleView?id=experience.networks_hide_components_by_device_type.htm&release=264.0.0&type=5 "Improve the readability of your site by hiding unnecessary components. In enhanced LWR sites, site builders can customize which components are shown or hidden for each device type—mobile, tablet, or desktop. Components are shown by default.")