cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
flyingspoon
Frequent Visitor

Checking Out / Checking In a SharePoint document that is linked in a Start and Wait for an Approval action

Hi everyone,

 

I have an approval request email reminder flow set up. It is triggered when an item is created in the SharePoint list. One of the variables in the list is a link to the policy document that needs reviewing. This link is included in the Start and Wait for an Approval action. 

 

Is there anyway to add onto this flow so that the document that is linked in the Start and Wait for an Approval action is also checked out in SharePoint so only the approver can access it, make edits, then check it back in? 

 

Top level current flow:

Edit_your_flow___Power_Automate.png

 

Detailed flow:

Edit_your_flow___Power_Automate-2.png

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @flyingspoon 

 

Okay so to get the File ID. Use:

'Get files (properties only)' On your Library. Than use:

'Filter array' action to filter the name of the file. (Filter array has to be used since SharePoint uses a calculated formula to get the name of the file. So we cannot use the regular filter query inside the SharePoint Get files action).

Select the Name dynamic content on the right side of the Filter array. and on the right side put the name of the file without extension. You can use any filter query you like. I am using name just as an example.

Flow1.png

 

Now inside the Check out and Check in actions we have to use an expression on the ID so we don't get put into the Apply to each loop.

My Filter array action is named 'Filter array' so my expression will be:

first(body('Filter_array'))?['ID']

This expression will be used on both the Check out action, and the Check in action:

Flow2.png

 

NOTE:

To see what can used for filter. Run the Flow and copy the Get Files output to notepad or some code editor to easily be read.

You mentioned you already had the Link to the file. So you could even use the Filter array action and filter on the Link

Jcook_0-1602787732092.png

 

 


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

5 REPLIES 5
Jcook
Super User III
Super User III

Hello @flyingspoon 

 

Have you tried using the 'Check out', and 'Check in' actions?

Jcook_0-1602781781823.png

 


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





Hey - @Jcook Yup, I am aware of those actions. I guess my question should be where should they be placed in the flow? Thanks - Flyingspoon

Hi @flyingspoon 

 

I would place Check Out before Approval. And Check In after the Approval.

Jcook_0-1602783568993.png

 

Note: I have done a small test, and I believe that the check out and check in is done by the SharePoint connection being used in Power Automate


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





@Jcook Would a Get Files action be needed since the files would be kept in a document library separate from the list? The list only includes a link to the document. Currently, In the dynamic content for Check Out, the only item showing is the list item ID. 

 

Edit_your_flow___Power_Automate-4.png

 

 

Hi @flyingspoon 

 

Okay so to get the File ID. Use:

'Get files (properties only)' On your Library. Than use:

'Filter array' action to filter the name of the file. (Filter array has to be used since SharePoint uses a calculated formula to get the name of the file. So we cannot use the regular filter query inside the SharePoint Get files action).

Select the Name dynamic content on the right side of the Filter array. and on the right side put the name of the file without extension. You can use any filter query you like. I am using name just as an example.

Flow1.png

 

Now inside the Check out and Check in actions we have to use an expression on the ID so we don't get put into the Apply to each loop.

My Filter array action is named 'Filter array' so my expression will be:

first(body('Filter_array'))?['ID']

This expression will be used on both the Check out action, and the Check in action:

Flow2.png

 

NOTE:

To see what can used for filter. Run the Flow and copy the Get Files output to notepad or some code editor to easily be read.

You mentioned you already had the Link to the file. So you could even use the Filter array action and filter on the Link

Jcook_0-1602787732092.png

 

 


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Users online (2,377)