How to Apply a 7-Year Retention Label from a SharePoint Date
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.

- 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.
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.
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.
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.
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.
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.
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.

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. Download the software: Visit the official WPS Office website and click the download button for your operating system.
- 2. Install WPS Office: Run the downloaded installer and follow the quick on-screen instructions to set up the suite.
- 3. Open your contracts: Launch WPS Writer or PDF to instantly open, edit, and save your existing contract documents without formatting loss.

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.




