---
schema_version: "1"
id: 7b3e7e7c6d30adc449977d0e97710b53d708e66369e797a497d1acddb190efdd
title: Create Criteria-Based Sharing Rules
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/security_sharing_rules_criteria.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.security_sharing_rules_criteria.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 901b8f326a49a162d5f3ee2f7a1710efb936a23ed9268eb376d2d8830687e55e
description: A criteria-based sharing rule determines who to share records with based on field values.
products:
  - Security
  - Salesforce Platform
release: "264"
---
# Create Criteria-Based Sharing Rules

A criteria-based sharing rule determines who to share records with based on field values.

### 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: both Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Professional</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d35827e75">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d35827e75 ">To create sharing rules:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d35827e75 ">Manage Sharing</td>

          </tr>
        </tbody>
      </table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-access-264-0-0-production-enus/a92be132-3cbc-412a-9262-130636120c14/images/icon_note.png)

Note For information on designing your sharing setup to improve performance and speed up sharing changes, see the [Designing Record Access for Enterprise Scale](https://developer.salesforce.com/docs/atlas.en-us.draes.meta/draes/draes_preface.htm) guide.

For example, you have a custom object for job applications, with a custom picklist field named “Department.” You create a criteria-based sharing rule to share all job applications in which the Department field is set to “IT” with all IT managers in your organization.

![Tip](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-access-264-0-0-production-enus/a92be132-3cbc-412a-9262-130636120c14/images/icon_tip.png)

Tip To get help from an AI agent on this task, use Setup with Agentforce. For more information, see [User Access Management in Setup with Agentforce](https://help.salesforce.com/s/articleView?id=xcloud.setup_agentforce_user_access.htm&language=en_US).

1. To include public groups in your sharing rule, confirm that those groups were created.
2. From Setup, in the Quick Find box, enter Sharing Settings, and then select **Sharing Settings**.
3. In the Sharing Rules related list for the object, click **New**.
4. Enter the label name and rule name. The label name appears on the user interface. The rule name is a unique name used by the API and managed packages.
5. Optionally, enter a description of the sharing rule of up to 1,000 characters.
6. For the rule type, select **Based on criteria**.
7. Specify the field, operator, and value criteria that records must match to be included in the sharing rule. The fields available depend on the object selected, and the value is always a literal number or string. To change the AND relationship between filters, click **Add Filter Logic**. The value criteria is limited to 240 characters, and strings or picklist values that go beyond this limit are truncated.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-access-264-0-0-production-enus/a92be132-3cbc-412a-9262-130636120c14/images/icon_note.png)
    
    Note You can use a field that’s not supported by criteria-based sharing rules. Create a workflow rule or Apex trigger to copy the value of the field into a text or numeric field. Then use that field as the criterion.
8. If available, select whether to include records owned by users who can’t have an assigned role, such as high-volume users and system users. This setting is enabled by default and can’t be edited after you save the rule.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-access-264-0-0-production-enus/a92be132-3cbc-412a-9262-130636120c14/images/icon_note.png)
    
    Note To include these users in criteria-based sharing rules that were created before Spring \`22, delete the rule and select **Include records owned by users who can't have an assigned role** when you recreate it.
9. Specify the users who get access to the data. For Share with, select a category from the first dropdown list and a set of users from the second dropdown list or lookup field.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-access-264-0-0-production-enus/a92be132-3cbc-412a-9262-130636120c14/images/icon_note.png)
    
    Note If you provide record access to external users by selecting the Portal Roles, Portal Roles and Subordinates, or Roles, Internal and Portal Subordinates as a target for the sharing rule category, you get an alert when you save the sharing rule.
    
    See [Sharing Rule Categories](https://help.salesforce.com/s/articleView?id=platform.security_sharing_data_set_categories.htm&release=264.0.0&type=5 "When you define a sharing rule, you can choose from the following categories in the owned by members of and Share with dropdown lists. Depending on the type of sharing rule and the features enabled for your organization, some categories may not appear.") for information on these categories.
10. Select sharing access settings for users. Some access settings aren’t available for some objects or in some situations.
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:50%">
              <col style="width:50%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d35827e240">
                  <span id="security_sharing_rules_criteria__AccessSetting"><a name="security_sharing_rules_criteria__AccessSetting"><!-- --></a>Access Setting</span>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d35827e246">
                  <span id="security_sharing_rules_criteria__Description"><a name="security_sharing_rules_criteria__Description"><!-- --></a>Description</span>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Access Setting" class="slds-cell-wrap" style="vertical-align:top;" headers="d35827e240 ">
                  <span id="security_sharing_rules_criteria__Private"><a name="security_sharing_rules_criteria__Private"><!-- --></a>Private</span>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d35827e246 ">
                  <p>
                    <span id="security_sharing_rules_criteria__PrivateDescription"><a name="security_sharing_rules_criteria__PrivateDescription"><!-- --></a>Users can’t view or update records, unless access is
                      granted outside of this sharing rule.</span>
                  </p>
                  <p style="margin-bottom:0;">Available only for associated contacts,
                    opportunities, and cases.</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Access Setting" class="slds-cell-wrap" style="vertical-align:top;" headers="d35827e240 ">
                  <span id="security_sharing_rules_criteria__ReadOnly"><a name="security_sharing_rules_criteria__ReadOnly"><!-- --></a>Read Only</span>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d35827e246 ">
                  <span id="security_sharing_rules_criteria__ReadOnlyDescription"><a name="security_sharing_rules_criteria__ReadOnlyDescription"><!-- --></a>Users can view, but not update, records.</span>
                </td>

              </tr>
              <tr class="">
                <td data-label="Access Setting" class="slds-cell-wrap" style="vertical-align:top;" headers="d35827e240 ">
                  <span id="security_sharing_rules_criteria__ReadWrite"><a name="security_sharing_rules_criteria__ReadWrite"><!-- --></a>Read/Write</span>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d35827e246 ">
                  <span id="security_sharing_rules_criteria__ReadWriteDescription"><a name="security_sharing_rules_criteria__ReadWriteDescription"><!-- --></a>Users can view and update records.</span>
                </td>

              </tr>
              <tr class="">
                <td data-label="Access Setting" class="slds-cell-wrap" style="vertical-align:top;" headers="d35827e240 ">
                  <span id="security_sharing_rules_criteria__FullAccess"><a name="security_sharing_rules_criteria__FullAccess"><!-- --></a>Full Access</span>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d35827e246 ">
                  <p>
                    <span id="security_sharing_rules_criteria__FullAccessDescription"><a name="security_sharing_rules_criteria__FullAccessDescription"><!-- --></a>Users in the selected group, role, or territory can
                      view, edit, transfer, delete, and share the record, just like the record’s
                      owner.</span>
                  </p>
                  <p>With a Full Access sharing rule, users can also view, edit, delete, and
                    close activities associated with the record if the org-wide sharing setting for
                    activities is Controlled by Parent.</p>
                  <p style="margin-bottom:0;">Available for campaigns only.</p>
                </td>

              </tr>
            </tbody>
          </table>
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-access-264-0-0-production-enus/a92be132-3cbc-412a-9262-130636120c14/images/icon_note.png)
    
    Note Contact Access isn’t available when the organization-wide default for contacts is set to Controlled by Parent.
11. Save your work.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-access-264-0-0-production-enus/a92be132-3cbc-412a-9262-130636120c14/images/icon_note.png)
    
    Note A sharing rule’s editable fields depend on its type. For criteria-based sharing rules, you can edit only the label, rule name, criteria filters, and sharing access level. If you must edit other fields, delete the rule and create a new one. .

After updates to sharing rules, sharing rules are recalculated to add or remove access as needed. Depending on the nature of your updates and your org’s setup, these sharing calculations can take a while to complete. If you experience sharing evaluations or timeouts, consider deferring sharing calculations before making large-scale updates, and then restart and recalculate sharing at a later time. For more information, see [Defer Sharing Calculations](https://help.salesforce.com/s/articleView?id=platform.security_sharing_defer_sharing_calculations.htm&release=264.0.0&type=5 "Performing a large number of configuration changes can lead to very long sharing rule evaluations or timeouts. To avoid these issues, a Salesforce admin can suspend sharing calculations, specifically for sharing rules and group membership, then resume calculations during an organization's maintenance period.") in Salesforce Help.

#### See Also

- [Sharing Rule Categories](https://help.salesforce.com/s/articleView?id=platform.security_sharing_data_set_categories.htm&release=264.0.0&type=5 "When you define a sharing rule, you can choose from the following categories in the owned by members of and Share with dropdown lists. Depending on the type of sharing rule and the features enabled for your organization, some categories may not appear.")
- [Sharing Rule Considerations](https://help.salesforce.com/s/articleView?id=platform.security_sharing_rule_considerations.htm&release=264.0.0&type=5 "Review these considerations before using sharing rules.")
- [Create Owner-Based Sharing Rules](https://help.salesforce.com/s/articleView?id=platform.security_sharing_rules_owner.htm&release=264.0.0&type=5 "An owner-based sharing rule opens access to records owned by certain users.")