logo
search
Compliance Problems

How to Apply a 7-Year Retention Label from a SharePoint Date

Partner EditorPartner Editor Sep 28, 2026 870 views

Question details

The user needs to trigger a Microsoft Purview retention label to start a seven-year period based on a contract end date stored in SharePoint metadata, ensuring it only activates once the date is populated.

How to Apply a Seven-Year Retention Label from a SharePoint Date
Product
Microsoft SharePoint
Device & OS
not provided
Scenario
Automating document lifecycle and compliance settings for contracts stored in a SharePoint document library.
Observed behavior
The retention period must remain inactive until the specific metadata field (contract end date) is filled out by a user.
Before you start

Ensure you have Microsoft Purview administrator permissions to create retention labels and access to Power Automate with permissions to read and modify the target SharePoint document library.

Solution 1Recommended

Use a Custom Power Automate Flow

Create a Power Automate flow to monitor the SharePoint metadata and automatically apply the retention label once the contract end date is populated.

Because standard Microsoft Purview retention labels do not natively trigger from dynamically populated SharePoint metadata without complex event-based retention setups, building a custom Power Automate flow is the most reliable and flexible approach.

1
Set up the flow trigger

Open Power Automate and create a new automated cloud flow. Choose the trigger 'When an item or a file is modified' and connect it to your specific SharePoint site and document library.

2
Add a condition to check the date

Insert a 'Condition' control into your flow. Set the condition to check if the 'Contract End Date' dynamic content is 'not equal to' null (empty). This ensures the flow only proceeds if a date has been entered.

3
Apply the retention label

In the 'If yes' branch, add an action to update the file's properties. Use the 'Send an HTTP request to SharePoint' action to update the item's compliance tag (retention label) to your pre-configured 7-year retention label.

4
Test the automation

Save the flow and upload a test document to your SharePoint library. Fill in the contract end date metadata and verify that the retention label is successfully applied to the document.

Use a Custom Power Automate Flow
Microsoft Community Support: For detailed implementation guidance and API payloads for the HTTP request, consulting the Microsoft Power Automate Community or Microsoft Purview documentation is highly recommended.
Free Microsoft Office alternative

Try WPS Office for Your Daily Document Needs

While SharePoint and Purview handle complex enterprise compliance, you still need a fast, reliable, and lightweight suite to draft those contracts. WPS Office offers a seamless, free alternative to Microsoft Office with full format compatibility.

  1. 1. Download the software: Visit the official WPS Office website and click the download button for your operating system.
  2. 2. Install WPS Office: Run the downloaded installer and follow the quick on-screen instructions to set up the suite.
  3. 3. Open your contracts: Launch WPS Writer or PDF to instantly open, edit, and save your existing contract documents without formatting loss.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Lightweight installation ensures smooth performance on older or less powerful devices.Includes a powerful built-in PDF toolkit for secure contract reviewing and editing.Free to use with a familiar, easy-to-navigate user interface.
microsoft office alternative - wps office

Frequently Asked Questions

Can I trigger a retention label without Power Automate?

Yes, Microsoft Purview supports event-based retention, but it requires specific licensing (like Microsoft 365 E5) and configuring event types in the compliance center, which can be much more complex than using a simple flow.

What happens if the contract end date is modified later?

If your Power Automate flow is set to trigger on modifications, you will need to add logic to your flow to either prevent overwriting an already applied label or to recalculate the timeline based on the new date.

Does the 7-year retention period start immediately when the label is applied?

It depends on how the label is configured in Microsoft Purview. The label itself should be configured to retain content for 7 years based on the date it was applied, or based on the specific metadata date provided if using event-based retention.