cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular 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
Highlighted

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
Highlighted
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




Highlighted

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

Highlighted

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




Highlighted

@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

 

 

Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

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