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.

  1. A document is up for disposal and initiates the workflow.
  2. Workflow gathers information on the content.
  3. Flow reviews a cross-reference list for the site
    1. Searches for the site and the label
  4. Once the correct list item is found, it determines the approvers and begins the approval process
  5. Once approvals have been received, send an approval request to the record manager.
  6. 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 ColumnTypeNotes
TitleSingle Line of TextRequired for List. Modified to optional field in CT
Retention Label NameSingle Line of TextName of the Retention Label in Purview
Retention Label IDSingle Line of TextGUID of the retention label within Microsoft Purview
Disposition Site SourceSingle Line of TextLocation of the file being disposed of
Disposition ApproversPerson or GroupMultiple users allowed
All Approvers RequiredChoiceOptions: 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.

Disposition Based on Document Location - Cross Reference CT within Site

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.

  1. Navigate to Power Automate’s “Maker” site (https://powerautomate.microsoft.com)
  2. Click on My flows and then + New flow
  3. Select Automated cloud flow

Disposition Based on Document Location - Create New Flow

  1. Provide the flow a name
  2. Search for M365 Compliance in the trigger search and select “When an item reaches end of its retention period”

Disposition Based on Document Location - Select the trigger

  1. Click Create
  2. If an error shows up on the trigger “Invalid Connection, please update your connection to load complete details”

Disposition Based on Document Location - Error in Trigger

  1. Click on the trigger and then “Change connection” in the configuration blade
  2. Select a connection (or create new) with the necessary roles within Purview (i.e. Compliance Admin, Record Management, etc)

Disposition Based on Document Location - Change the Connection    Disposition Based on Document Location - Select the Connection Account

  1. Next, add an activity like initializing a variable, such as the URL of the site where the document is located.

Disposition Based on Document Location - Add First Activity

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

  1. Login to the records management console within Microsoft Purview
  2. Click on the File plan tab and click “+ Create label”
  3. Provide the label with a meaningful name and description based on your organization’s record plan and click Next.
  4. Fill in the necessary descriptors for the label (optional) and click Next.
  5. Select the label retention settings and click Next.

Create a Simple Power Automate Disposition Review - LabelRetentionSettings

  1. Fill in the required retention timeline based on the file plan and click Next.

Create a Simple Power Automate Disposition Review - LabelRetentionPeriod

  1. Select how the label will protect the document during the retention period and click Next.
  2. At the screen “Choose what happens after the retention period,” select the option “Run a Power Automate Flow
  3. Click on “+ Select a flow
  4. Select the flow created above.
  5. Click Apply and then Next.

Create a Simple Power Automate Disposition Review - SetRunPowerAutomateFlow

  1. Review the configurations and click Create Label
  2. 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.

Disposition Based on Document Location - Populate Cross Reference 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!