2 ways SharePoint Online check in all files using Power Automate quickly

2 ways in SharePoint Online check in all files using Power Automate quickly

No comments

 5 total views,  5 views today

In this “SharePoint Online check in all files using Power Automate” 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.

SharePoint Online check in all files using Power Automate

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
Check in multiple files using Power Automate in SharePoint Online
Check-in multiple files using Power Automate in SharePoint Online

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:

Get checked out files using Power Automate from the SharePoint Online document library
Get checked-out files using Power Automate from the SharePoint Online document library

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.

Check in files using Power Automate from the SharePoint Online document library
Check-in files using Power Automate from the SharePoint Online document library

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
Check in type in Power Automate for SharePoint Online documents
Check-in type in Power Automate for SharePoint Online documents

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.

Check in files using Power Automate in SharePoint Online document library - Demo
Check-in files using Power Automate in SharePoint Online document library – Demo

Now, let’s execute the flow.

Check in files using Power Automate in SharePoint Online document library – Demo Flow executed

Flow executed successfully.

Check in files using Power Automate in SharePoint Online document library - Demo Flow executed
Check-in files using Power Automate in SharePoint Online document library – Demo Flow executed

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.

Multiple files checked in using Power Automate in SharePoint Online
Multiple files checked in using Power Automate in SharePoint Online

Notes:

  • 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

Filter Checked Out files in SharePoint Online view
Filter Checked Out files in SharePoint Online view

This will display all checked-out files.

Checked out files in SharePoint Online view
Checked out files in SharePoint Online view

Notes:

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

Check in and discard check out in SharePoint Online manually
Check-in and discard check-out in SharePoint Online manually

Good to know about check-in and check-out :

Below are the concepts we must know while we work on the files check out/discard check out/check-in.

What is discard checkout in SharePoint?

If your document library has the document version history enabled, a new version is created each time you check a file back into the library (major or minor version based on the configuration in the document library). By discarding the checkout, we can avoid making new versions, and after discarding we can work with the last checked-in version of the file, basically, when you haven’t made any changes to the file, you can discard the checkout. It will dismiss all changes from the checked-out version if you have done some changes to the file and performed a discard checkout action.

What is checkout in SharePoint?

When we check out a file (document) from a SharePoint document library, only we (the person who checked out) can edit it. Basically, you are locking the files from other users for editing.  We can edit the file in Microsoft 365 online or offline (editing from the local office app).

What is check-in (check in files) in SharePoint?

Once you are done with your file editing work, you need to check the file in, once you check in the file, a major or minor version of the file will be created in the version history. After doing the check in the file, other users can see the latest version of the file. While check-in we must add some comments to the check-in version, this will help in the auditing.

Summary: What we had here (SharePoint online check in all files using Power Automate – Check in all files SharePoint)?

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

You may also like the below Power Automate tutorials:

 

About Post Author

Do you have a better solution or question on this topic? Please leave a comment