---
schema_version: "1"
id: 7415bf8b687e311d0ce00824e2ff0f94c7b0d7182d0666f2f66854fa3ac10ada
title: Create and Customize Retention Policies for Data and Storage
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/data_retention.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.data_retention.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: fd6c9e0e86711ad43113cfc3bd87f3aa69807f884e72d86acdb7265ef39afbb2
description: Use the Retention Policies feature to create policies that copy customer data and store it. You can also make PII anonymous in your org and in the data retention store. Or, you can delete data from your org when it copies to the retention store. Choose to anonymize fields or records by replacing them with random characters or mock data.
products:
  - Security
  - Cross Cloud
release: "264"
---
# Create and Customize Retention Policies for Data and Storage

Use the Retention Policies feature to create policies that copy customer data and store it. You can also make PII anonymous in your org and in the data retention store. Or, you can delete data from your org when it copies to the retention store. Choose to anonymize fields or records by replacing them with random characters or mock data.

### Required Editions

<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="d24780e27">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d24780e27 ">To create and use Retention:</td>
            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d24780e27 ">ModifyAllData and PrivacyCenter</td>
          </tr>
        </tbody>
      </table>

1. From the Privacy Center dashboard, under Retention Policies, click **View All**.
2. Click **New**, then enter a name for your policy. The name must be alphanumeric with no spaces or special characters. Optionally, add a description for your policy.
3. Click **Save & Edit**.
4. Under Settings, select a frequency for the policy to run at.
    - Run Once (Now): The policy immediately runs one time when you click **Run**.
    - Run Once (Scheduled): The policy runs one time at the date and time you indicate.
    - Daily: The policy runs every day at the same time and starts on the date and time that you indicate.
    - Weekly: The policy runs one time a week on the day and time that you indicate.
    - Monthly: The policy runs one time a month on the day and time that you indicate. If your selected day isn’t valid for a specific month (for example, February 29), Privacy Center uses the last valid day of that month (February 28).
    - Yearly: The policy runs one time a year on the day and time that you indicate.
5. Select a Start Date and Time.
6. Under Objects & Fields, choose an object to run the policy on. You can only run retention policies on [supported objects](https://connect.heroku.com/supported-objects). Change the object in the policy to **Active**.
    
    ![Add parent object to Retention Policy](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-data_protection_and_privacy-264-0-0-production-enus/27d1bf87-a47b-491a-8339-f53ef6540aec/data_protection_and_privacy/images/retention_parent_object.png)
    
    Policies run on active objects only. If you create a policy and later determine that you don’t want to include an object, switch the object to **Inactive**.
7. Under Action on Data In Org, choose to delete or mask the data. If you choose to delete, the original record and data are deleted from your org and only the data in fields marked Retain moves to storage. If you choose to mask, the original data moves to storage, and you can indicate how the data for each field is masked in your org in Step 9.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-data_protection_and_privacy-264-0-0-production-enus/27d1bf87-a47b-491a-8339-f53ef6540aec/images/icon_note.png)
    
    Note Only data in your Salesforce org is masked. The data in your Heroku data store remains untouched.
8. Optionally, you can add data filters to your object to capture fields that meet certain criteria. For example, apply a filter so that your policy captures only the data that’s created in the object after a specific date. Conditions created translate into a WHERE clause that filters the data retrieved during execution in Heroku.
    
    ![Add data filter to parent object](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-data_protection_and_privacy-264-0-0-production-enus/27d1bf87-a47b-491a-8339-f53ef6540aec/data_protection_and_privacy/images/retention_filter_object.png)
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-data_protection_and_privacy-264-0-0-production-enus/27d1bf87-a47b-491a-8339-f53ef6540aec/images/icon_note.png)
    
    Note When you apply a filter to a parent object, only the child records of the filtered parent records are affected. For example, if you set a filter that captures only the data created for an object after a specific date, only child records of the parent that are created after the specific date are processed.
9. For each field, select a Delete or Mask option.
    - If you chose **Delete** for Action on Data in Org, at the field level choose **Retain** to move the original data into storage. Or leave the option blank to permanently delete the data. Some fields must be retained and automatically populated.
    - If you chose **Mask** for Action on Data in Org, at the field level choose from four options. Choose **Delete** to remove the data from your org and save a copy in storage. Choose **Replace from Library** to replace the data in your org with fake data. Choose **Replace with Random Characters** to replace the data in your org with random values.
    - Optionally, check the box next to Unique to add the record’s Salesforce ID to the field value. This option creates a globally unique value for the record that’s saved in storage. With the Unique Value checkbox, values are truncated to meet the max length of the field. For example, a value of ABCDE appended with an Id of 005E0000004fQu7 becomes ABCDE005E0 to maintain the max field length of 10. Selecting this option increases overall run time.
        
        Any field with compliance categorization metadata is marked with an orange triangle. To display details on the related compliance category, hover over the triangle.
10. Save your work after you edit the object.
11. In the Objects column, expand the dropdown list under your object to select any child objects that you want to include in the policy. Make selections on the child object, then save your work.
    
    ![Add child objects to Retention Policy](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-data_protection_and_privacy-264-0-0-production-enus/27d1bf87-a47b-491a-8339-f53ef6540aec/data_protection_and_privacy/images/retention_child_object.png)
12. After you edit your policy, click **Activate**.