Power Automate - Archive SharePoint Online Document Set

Introduction

 
In this article, we will explore the modern SharePoint online document set on how to archive using power automate. In the previous article, we covered the Modern SharePoint Online Document Set creation steps.
 

Scenario

 
The customer requires the HR Department’s new employee onboarding operation team system. When the new candidate joins, the HR department creates a document set of that candidate with all the related documents folder in that document set in the document library, and when a candidate is resigning then the system automatically handles archive all the information of that employee.
 
This should be achieved using Power automate.
 

Objective

 
We have created a document set and associated with two document libraries, the Appointments, and the Appointments Archive.
 
We create power automate to automatically archive the resigning employee information in the Appointments Archive document library.
 
We have created an Appointments document library for adding new candidate's information and Appointments Archive document library created for resigned candidate's information that is stored.
 
Step 1
 
Go here and log in with your Office 365 account.
 
We start with a blank canvas and build the Flow ourselves. Therefore, click the +New button and select “Automated – from blank, follow the numerical points, as shown in the below screenshot:
 
Power Automate - Archive SharePoint Online Document Set
 
Provide a name and choose which Flow will trigger (or start). In our case, this will be “When a file is created (properties only)” then click the Create button. Follow the numerical points, as shown in the below screenshot:
 
Power Automate - Archive SharePoint Online Document Set
 
Enter the site address (URL) and select the list on which you want this Flow to run:
 
Power Automate - Archive SharePoint Online Document Set
 
Step 2
 
Click Power Automate - Archive SharePoint Online Document Set the button below this first step to add a new action in the Search box by typing “Get files (properties only)” in the search bar and find the following action: “Get files (properties only). This action will apply the filter on the document library ContentType.
 
Power Automate - Archive SharePoint Online Document Set
 
Step 3
 
Add a new action – ‘Apply to each’, step, and loop through all get as collected property file #steps 2.
 
Add a condition to check if the “Status” is not equal to None or Resigned
 
Power Automate - Archive SharePoint Online Document Set
 
Step 4
 
If Status is Resigned, then the next step is to come to the Yes section. In this section, we copy the candidate document set from the Appointments document library to the Appointments Archive document library. After copying the document set, remove this document set from the Appointments document library.
 
Power Automate - Archive SharePoint Online Document Set
 
Output
 
Before taking action resigned, both the document library with the document set are shown below:
Power Automate - Archive SharePoint Online Document Set
Power Automate - Archive SharePoint Online Document Set
 
Final Output
 
Power Automate - Archive SharePoint Online Document Set