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

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

v-bacao-msft
Community Support
Community Support

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

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

v-bacao-msft
Community Support
Community Support

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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (48,889)