509 total views, 1 views today
In this “check in multiple files in SharePoint” article, we will learn how to check in multiple files using Power Automate, if the files are checked by some users. First, we will see how to check in files using the Power Automate flow either manual or scheduler, then we will see how to check the files using the SharePoint Online checked-out files view.
Many times what happens is – users forget to check the files in what they are working on, this will prevent you from further management of the files, for example, if we cannot delete or move checked-out files, for this we must check the files in.
Check in multiple files in SharePoint using Power Automate (Check in Files)
Using Power Automate we can easily check multiple files at once. Here in this demo, we have created a manually triggered flow, however, if you have a large number of checked-out files, you need to create a scheduler Power Automate which will run periodically. The benefit of running the Scheduler Power Automate is – it will periodically check whether is there any checked-out files in a library, if yes, the scheduler flow will check those files in, with no need for manual monitoring.
The Power Automate flow is very simple – it has just two steps:
- Get checked-out files using Power Automate
- Check-in files using Power Automate
Let’s understand the Get files (properties only) action and Apply it to each control – what is there in it.
Get checked out files using Power Automate from the SharePoint Online document library
Below is the Get files (properties only) configuration:
Parameters in the Get files (properties only) action:
- Site Address – Your site URL
- Library Name – Your document library name (Title).
- Filter Query – CheckoutUserId ne null
- Top Count – If your document library has more than 5000 checked-out documents, then need to pass less than or equal to 5000 in the Top Count parameter to avoid the threshold limit issue.
By, now using the Get files (properties only) action we have the checked-out files report, next we need to loop through each checked-out file to check them in, for that we need to add a apply to each control.
Check in files using Power Automate from the SharePoint Online document library
After getting the checked-out files report, to check in files, we need to add an Apply to each control.
Configure the below for the Apply to each control:
- Select an output from previous steps – Value
- Add two actions inside it – Get Item and Check in the file
- In Get Item – Pass the Site URL, Document Library Name, and the ID from the previous step (Get files (properties only)).
- In Check in file -Pass the Site URL, Document Library Name, and the ID from the previous step (Get Item). For comments, some meaningful text for compliance and auditing purpose, then select check-in type from the dropdown list.
Check in type in Power Automate for SharePoint Online documents
Below is the available check-in type:
- Major version (publish)
- Minor version (draft)
- Overwrite the file which is nothing but discard check out.
- Enter custom value
Now, if we execute this Power Automate, all files in the given document library which were checked out to someone will be checked in.
Check in files using Power Automate in SharePoint Online document library – Demo
We have below checked out the files in our library.
Now, let’s execute the flow.
Check in files using Power Automate in SharePoint Online document library – Demo Flow executed
Flow executed successfully.
Multiple files checked in using Power Automate in SharePoint Online – Demo
Now, we can see that all documents were checked out before executing the flow, now those documents have been checked in automatically.
- If you have a few checked-out documents, you can use the above Power Automate technique and run it manually as per your need, and if you have more checked-out documents (many thousands) and want to check those in at a time – then you need to add the above Power Automate logic inside the loop (Get Files (properties only) and Apply to each control should be in another loop), this will run the flow till all checked out files are checked in the state.
- This approach is not recommended if you have thousands of checked-out documents – in that scenario, we need to create a scheduler Power Automate, which will run periodically.
By now, we learned how to check the files which are in the checked-out state using Power Automate, now we will learn how to check the files from SharePoint Online view.
Check in files using the SharePoint Online view manually
Create a Checked Out view and add the below filter.
Filter Checked Out files in SharePoint Online view
Checked Out To is not equal to empty
This will display all checked-out files.
- The documents that we have checked in using Power Automate – again from this demo, checked out those same files – so, don’t get confused on this.
- If you have more than 5000 checked-out files in your document library, then the “Checked Out To is not equal to empty” filter is not good enough, you need to add more “AND” conditions to control the threshold limit error.
Check in files and discard check out SharePoint Online manually
Select the file (files) from the file selection checkbox menu.
Click on the three dots from the ribbon menu next to Move to button.
Click on the check-in or Discard check out based on your need.
Summary: What we had here (Check in files in SharePoint using Power Automate)?
Thus, in this article, we have learned the below with respect files check-in and check-out:
- How to SharePoint Online check in all files using Power Automate
- How to get checked-out files using Power Automate from the SharePoint Online document library.
- Check-in type in Power Automate for SharePoint Online documents.
- Check-in files using the SharePoint Online view manually.
- Filter Checked Out files in SharePoint Online view.
- Check-in files and discard check-out SharePoint Online manually.
See Also: Power Automate Tutorial (Power Automate Articles Hub)
You may also like the below Power Automate tutorials: