Previously, I showed you how to use Power Automate to build a custom workflow to assign approvers based on the site owner. It was designed to access the user(s) designated as site owners and assign the disposition approval to them. In addition, it allowed you to provide custom messages and any other non-standard activities your organization required. I will take a different approach in this post and assign record disposition based on document location. The idea is that labels are shared across the organization, and each site could belong to a particular data owner that does not map to the site ownership. The flow will target these data owners based on the document’s location. This first post highlights the components that need to be in place to support the flow. If you want to go straight to the flow components, continue to the second post in this series. However, I urge you to read on here first to understand what needs to be in place to support the solution as a whole. Before continuing, ensure you aren’t going to run into any of the Power Automate limitations within Purview.
Assign Record Disposition Based on Document Location
The Process
I’ll break out the steps here and then get into details in the next step.
- A document is up for disposal and initiates the workflow.
- Workflow gathers information on the content.
- Flow reviews a cross-reference list for the site
- Searches for the site and the label
- Once the correct list item is found, it determines the approvers and begins the approval process
- Once approvals have been received, send an approval request to the record manager.
- Dispose of the record.
This post will include the major components of the flow.
The Cross Reference List
Let’s start with the list that will be used to cross-reference the retention label with the SharePoint site to determine the approver. This list will need to store the retention labels being used, the sites they exist in, and the approver(s) for the content disposition. Let’s start with the content type. I created a content type called “Retention Label Cross Reference” with the following metadata to meet the needs of the workflow I wanted to create.
| Site Column | Type | Notes |
|---|---|---|
| Title | Single Line of Text | Required for List. Modified to optional field in CT |
| Retention Label Name | Single Line of Text | Name of the Retention Label in Purview |
| Retention Label ID | Single Line of Text | GUID of the retention label within Microsoft Purview |
| Disposition Site Source | Single Line of Text | Location of the file being disposed of |
| Disposition Approvers | Person or Group | Multiple users allowed |
| All Approvers Required | Choice | Options: No (Default), Yes |
Once the content type is created, create a new list (suggested name: Disposition Cross Reference) within a site you wish to house this sort of support content, add the “Retention Label Cross Reference” content type, and (optionally) remove the default Item content type.
Create the Power Automate’s First Activity
Before we can do anything else, we need to start the workflow. You don’t need to build out the entire workflow immediately (we’ll cover that in the next post), but at least create a flow with a trigger and a single activity (you need at least one activity to save the flow). The reason I suggest you hold off building out the flow is you are going to need to test it, right? Well, to test it, you need to have content that is up for disposition. We all know waiting for content to be ready for disposition is not a quick turnaround, so the sooner you can get data ready to be disposed of, the sooner you have data to test your flow with before releasing it to production.
- Navigate to Power Automate’s “Maker” site (https://powerautomate.microsoft.com)
- Click on My flows and then + New flow
- Select Automated cloud flow
- Provide the flow a name
- Search for M365 Compliance in the trigger search and select “When an item reaches end of its retention period”
- Click Create
- If an error shows up on the trigger “Invalid Connection, please update your connection to load complete details”
- Click on the trigger and then “Change connection” in the configuration blade
- Select a connection (or create new) with the necessary roles within Purview (i.e. Compliance Admin, Record Management, etc)
- Next, add an activity like initializing a variable, such as the URL of the site where the document is located.
- Save the workflow. We’ll leave the rest for the next post.
Build the Retention Label
Now that the Power Automate flow exists within the environment, it is time to create the label.
- Login to the records management console within Microsoft Purview
- Click on the File plan tab and click “+ Create label”
- Provide the label with a meaningful name and description based on your organization’s record plan and click Next.
- Fill in the necessary descriptors for the label (optional) and click Next.
- Select the label retention settings and click Next.
- Fill in the required retention timeline based on the file plan and click Next.
- Select how the label will protect the document during the retention period and click Next.
- At the screen “Choose what happens after the retention period,” select the option “Run a Power Automate Flow“
- Click on “+ Select a flow“
- Select the flow created above.
- Click Apply and then Next.
- Review the configurations and click Create Label
- Deploy your label and wait for a document to trigger for retention.
Special Note: If the flow does not show up AND the account being used to create the label is either the creator or co-owner of the flow, check to see if the flow was created within a non-default Power Automate environment. More information on this process and how to create the flow can be found in my previous post.
Add Label Information to Cross Reference List
The final step before building out the Power Automate flow is to add the content to the cross-reference list the flow will need to function. An additional step will be required as Microsoft Purview does not pass the label name to the flow trigger, but instead, it passes the label ID (GUID). This GUID can only be attained with PowerShell. Use the process outlined in this short post to gather the ID’s of the labels to be used in the list.
As can be noted in the screenshot above, the retention label name is used for easy identification. Additionally, take note that the label and ID are the same, but the site source and approvers are not. This is a key illustration of how the flow will function.
Next, we’ll dig into the flow itself.
Thanks for reading!











Leave a Reply