cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jklevela
Regular Visitor

Check if SharePoint document is checked in

Hi,

I have an approval flow that a user may trigger from a doc.library.

Is it possible to only make that Flow menu item to start the approval flow visible when the selected item is checked in, and not visible otherwise?

 

Or/and..

How to check if a SP document is checked in in the Flow?

And how to check it in?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Anonymous
Not applicable

Re: Check if SharePoint document is checked in

HI jklevela,

 

I am sorry but I couldn't understant the first part of your question. For the second one, yes there is a way via HTTP cal to your sharepoint site collection to check if the document is checked out or not:

 

Make a simple get HTTP call to: 

https://{base url}.sharepoint.com/sites/{site name}/_api/web/GetFolderByServerRelativePath(decodedurl='/sites/{site name}/{folder name}')/Files

 

Then will list you all the documents and if you don't know the id or you want to make it more dynamic,  filter directly by name or for eah one, check which one your are interested.

 

The property "d:CheckOutType " eq to 0 indicates this is checked out. For more information (who, when?)  extend your call (once you have the reference of the file) with:

 

Web/GetFileByServerRelativePath(decodedurl='decodedurl='/sites/{site name}/{folder name}')/{file name.extension}')/CheckedOutByUser

 

Hope it helps 🙂

View solution in original post

Community Support
Community Support

Re: Check if SharePoint document is checked in

Hi @jklevela,

 

Currently there is no direct action in Flow to be able to check in the files in the SharePoint library.

Please vote for similar idea:

https://powerusers.microsoft.com/t5/Flow-Ideas/Allow-to-check-in-check-out-and-publish-files-in-a-Sh...

Here are some users who seem to use Send http request to SharePoint action to implement the check-in file operation, you could use as a reference:

Please refer to the link below, which mentions how to check in the file in the SharePoint library:

https://support.office.com/en-us/article/check-out-check-in-or-discard-changes-to-files-in-a-library...

As to checking if the file has been checked in, you could try to use Send http request to SharePoint action to see if the file has been checked out.

Use the following Expression to get the CheckoutUserId. If it is empty, the file has been checked in. No one has checked out this file yet.

body('Send_an_HTTP_request_to_SharePoint')['d']['CheckoutUserId']

Image reference:

11.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Re: Check if SharePoint document is checked in

HI jklevela,

 

I am sorry but I couldn't understant the first part of your question. For the second one, yes there is a way via HTTP cal to your sharepoint site collection to check if the document is checked out or not:

 

Make a simple get HTTP call to: 

https://{base url}.sharepoint.com/sites/{site name}/_api/web/GetFolderByServerRelativePath(decodedurl='/sites/{site name}/{folder name}')/Files

 

Then will list you all the documents and if you don't know the id or you want to make it more dynamic,  filter directly by name or for eah one, check which one your are interested.

 

The property "d:CheckOutType " eq to 0 indicates this is checked out. For more information (who, when?)  extend your call (once you have the reference of the file) with:

 

Web/GetFileByServerRelativePath(decodedurl='decodedurl='/sites/{site name}/{folder name}')/{file name.extension}')/CheckedOutByUser

 

Hope it helps 🙂

View solution in original post

Community Support
Community Support

Re: Check if SharePoint document is checked in

Hi @jklevela,

 

Currently there is no direct action in Flow to be able to check in the files in the SharePoint library.

Please vote for similar idea:

https://powerusers.microsoft.com/t5/Flow-Ideas/Allow-to-check-in-check-out-and-publish-files-in-a-Sh...

Here are some users who seem to use Send http request to SharePoint action to implement the check-in file operation, you could use as a reference:

Please refer to the link below, which mentions how to check in the file in the SharePoint library:

https://support.office.com/en-us/article/check-out-check-in-or-discard-changes-to-files-in-a-library...

As to checking if the file has been checked in, you could try to use Send http request to SharePoint action to see if the file has been checked out.

Use the following Expression to get the CheckoutUserId. If it is empty, the file has been checked in. No one has checked out this file yet.

body('Send_an_HTTP_request_to_SharePoint')['d']['CheckoutUserId']

Image reference:

11.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (7,692)