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:
Detailed flow:
Solved! Go to Solution.
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.
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:
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
Proud to be a Flownaut!
Hello @flyingspoon
Have you tried using the 'Check out', and 'Check in' actions?
Proud to be a Flownaut!
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.
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
Proud to be a Flownaut!
@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.
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.
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:
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
Proud to be a Flownaut!
User | Count |
---|---|
103 | |
36 | |
29 | |
25 | |
16 |
User | Count |
---|---|
136 | |
54 | |
53 | |
36 | |
26 |