---
schema_version: "1"
id: e029637c6fd8f4b417f9732fcf326ceb9860e9ac421baf9bcc47e6c31d4c3fe8
title: Identify Object Records that You Want to Archive
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/archive_object_filter.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.archive_object_filter.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 80860e0063f3c872833f9742c9c3d1100695559b55252cf863fd93236fcf95d1
description: Select an object and apply filter conditions. You can archive records that meet any condition, all conditions, or a custom set of conditions in Legacy Salesforce Archive.
products:
  - Salesforce Platform
  - Cross Cloud
release: "264"
---
# Identify Object Records that You Want to Archive

Select an object and apply filter conditions. You can archive records that meet any condition, all conditions, or a custom set of conditions in Legacy Salesforce Archive.

### 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: <strong>Developer</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, and <strong>Unlimited</strong> Editions. Requires the Salesforce Archive license.</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="d157342e66">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d157342e66 ">To create, edit, and schedule Archive Policies:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d157342e66 ">Manage Archive Policies</td>

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

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-setup-264-0-0-production-enus/6f21df35-9ea0-4f53-ac94-45c3b5dfd5bc/images/icon_note.png)

Note This content relates to Legacy Salesforce Archive. Read about the Archive managed package in [Own from Salesforce](https://help.salesforce.com/s/articleView?id=platform.own_from_salesforce.htm&type=5&language=en_US).

1. On the policy details page, click **Configure Object**.
    
    If you don't see a standard or custom object in the Available Objects panel, check with your admin to make sure that you have the correct user permissions.
2. Under Available Objects, select an object.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-setup-264-0-0-production-enus/6f21df35-9ea0-4f53-ac94-45c3b5dfd5bc/images/icon_note.png)
    
    Note You can't select the User object because User records can't be deleted.
3. Enter an optional description for the object, and then click **Next**.
4. Under Apply Policy, select an option.
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col style="width:33.33333333333333%">
              <col style="width:33.33333333333333%">
              <col style="width:33.33333333333333%">
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d157342e149">Conditional Logic</th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d157342e152">Function</th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d157342e155">Example</th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Conditional Logic" class="slds-cell-wrap" style="vertical-align:top;" headers="d157342e149 "><strong class="uicontrol">To All Records</strong></td>

                <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d157342e152 ">Archives every record on the object. No filter is applied.</td>

                <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d157342e155 ">--</td>

              </tr>
              <tr class="">
                <td data-label="Conditional Logic" class="slds-cell-wrap" style="vertical-align:top;" headers="d157342e149 "><strong class="uicontrol">When All Conditions Are Met</strong></td>

                <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d157342e152 ">Archives records that meet all of the conditions you set.</td>

                <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d157342e155 ">Set a condition that the Account Source equals <kbd>Web</kbd>,
                  and set another condition that the Created Date equals <kbd>January 1</kbd>.
                  If a record's source is Web and the record was created on January 1, then the record
                  is archived.</td>

              </tr>
              <tr class="">
                <td data-label="Conditional Logic" class="slds-cell-wrap" style="vertical-align:top;" headers="d157342e149 "><strong class="uicontrol">When Any Condition Is Met</strong></td>

                <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d157342e152 ">Archives records that meet any of the conditions you set. </td>

                <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d157342e155 ">Set a condition that the Account Source equals <kbd>Web</kbd>, and
                  another condition that the Created Date equals <kbd>January 1</kbd>. If
                  a record's source is Web or the record was created on January 1, then the record is
                  archived.</td>

              </tr>
              <tr class="">
                <td data-label="Conditional Logic" class="slds-cell-wrap" style="vertical-align:top;" headers="d157342e149 "><strong class="uicontrol">Custom</strong></td>

                <td data-label="Function" class="slds-cell-wrap" style="vertical-align:top;" headers="d157342e152 ">
                  <p>Archives records according to boolean condition logic that you
                    enter.</p>
                  <p>Limitations:</p>
                  <ul>
                    <li>If you add a cross-object query to your custom filter, you can't have multiple
                      queries for the same parent and child relationship. For multiple cross-object queries
                      on the same parent object, use custom logic and different child objects. You can't use
                      <code>AND</code> or <code>OR</code> logic for queries on the same child object.
                      For example, create cross-object queries in the same policy from the Contact object to
                      the <code>Contact.PrimaryAccount</code> and <code>Contact.SecondaryAccount</code>
                      child objects.
                    </li>

                    <li>When you apply a custom logic, filter conditions aren't supported on cross-object
                      queries. While configuring the cross-object query, under Apply Policy, select
                      <strong class="uicontrol">To All Records</strong>.
                    </li>

                  </ul>
                </td>

                <td data-label="Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d157342e155 ">
                  <p>Set the first condition as the Account Source equals <kbd>Web</kbd>, the
                    second condition as the Created Date equals <kbd>January 1</kbd>, and the
                    third condition as the Primary field equals <kbd>True</kbd>. Then set the
                    conditional logic to capture your desired combination of these conditions, such as
                    <kbd>(1 OR 2) AND 3</kbd>.
                  </p>
                  <p style="margin-bottom:0;">You can also filter for records that don't
                    meet a certain condition by adding <kbd>!</kbd> in your conditional logic.
                    For example, <kbd>(1 OR 2) AND !3</kbd> filters for records that meet either
                    condition 1 or 2 and don't meet condition 3.</p>
                </td>

              </tr>
            </tbody>
          </table>
    
    If you selected **To All Records**, the remainder of this task doesn't apply to your configuration.
5. Click **Add Condition**, and then select values for the Object Field, Operator, and Criteria fields.
6. Optionally, click **Add Parent Condition**.
    
    Parent conditions check the value of a field that's up to five levels above in the object hierarchy to determine whether a record is archived. For example, set a parent condition that Case records are archived if the Case > Contact > Account > Billing Zip/Postal Code field has a value of 94105.
7. Optionally, click **Add Cross-Object Query**.
    
    Cross-object queries filter records on the current object using conditions that you apply to a related object. For example, you can archive records on the Account object where the Case child object doesn't have any new records in the last six months. In the Cross-Object Query for Case, add a condition with the object field set to Created Date, the operator set to is after, and the number of days set to 186. You can cross-object query to only one level down in the hierarchy of related objects.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-setup-264-0-0-production-enus/6f21df35-9ea0-4f53-ac94-45c3b5dfd5bc/images/icon_note.png)
    
    Note You can't apply cross-object queries to polymorphic fields, such as the Owner, Who, or What fields. For more information, see [Understanding Relationship Fields and Polymorphic Fields](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_and_polymorph_keys.htm#common-polymorphic-fields).
    
    ![Cross-object query configuration screen](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-setup-264-0-0-production-enus/6f21df35-9ea0-4f53-ac94-45c3b5dfd5bc/setup/images/archive_cross_object_query.png)
    
    1. From the dropdown list, select a related object to query. Next to the related object's name is the field that associates the two objects.
    2. Under Add Result Rule, select **True** if you want records that meet your conditions to be processed, or **False** if you don't want the records to be processed.
        
        ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-setup-264-0-0-production-enus/6f21df35-9ea0-4f53-ac94-45c3b5dfd5bc/images/icon_note.png)
        
        Note Records on the related object that you query are never processed by the policy.
    3. In the Filter Conditions section, follow the steps to set conditions for the related object.
8. When you're finished adding filter conditions, click **Next**.

You're ready to define how related files and attachments are handled when their records become archived.

#### See Also

- [Configure Files and Attachments for Archived Records in Legacy Salesforce Archive](https://help.salesforce.com/s/articleView?id=xcloud.archive_files_attachments.htm&release=264.0.0&type=5 "Select what happens to files and attachments when their associated records become archived in Legacy Salesforce Archive.")