Forum Discussion
RichPepp
Sep 26, 2019Copper Contributor
Locking a file for approval
My apologies for asking this here, I've been searching for a long time to resolve this and I'm sure I'm missing a trick somewhere. What I want to do is to create a document approval flow whereby the...
- Sep 27, 2019
Hi RichPepp,
My initial thought was to add "Check-out" and "Discard Check-out" Actions to an existing approval Flow template but that didn't workout because the "Eid" field (used when setting the Content Approval Status) changed from "Check-Out" and "Discard Check-out" actions.
If you turn off Content Approval and use a custom Flow you can achieve most of what you outline. When a file is added it triggers the Flow and "Checks out" the file. I added a site column called Status.
Once approved the Status is set to "Approved" and the "Check out" is discarded.
If rejected, the Status is set accordingly and the "Check out" is discarded.
Here is the Flow I used:
It's important to note that the file version will increase with each action against the file (i.e. Status column changes). Not sure if that is a show stopper.
I hope this helps.
Norm
Norman Young
Sep 27, 2019MVP
Hi RichPepp,
My initial thought was to add "Check-out" and "Discard Check-out" Actions to an existing approval Flow template but that didn't workout because the "Eid" field (used when setting the Content Approval Status) changed from "Check-Out" and "Discard Check-out" actions.
If you turn off Content Approval and use a custom Flow you can achieve most of what you outline. When a file is added it triggers the Flow and "Checks out" the file. I added a site column called Status.
Once approved the Status is set to "Approved" and the "Check out" is discarded.
If rejected, the Status is set accordingly and the "Check out" is discarded.
Here is the Flow I used:
It's important to note that the file version will increase with each action against the file (i.e. Status column changes). Not sure if that is a show stopper.
I hope this helps.
Norm
- RichPeppSep 27, 2019Copper Contributor
Hi Norman Young
Thank you VERY much for trying that out. I had wanted to try it that way but failed because when I added the CheckOut action I needed 3 bits of info. The site address and library name were easy but then I also needed the 'Id of the list item the file is attached to'. My document was in a document library rather than a list so there was no id to use that I could think of.
I don't really have a problem using a list if that is necessary but can you tell me how you structured things to manage this? The CheckOut method does seem like a good idea to me
And thanks again for doing that, it was extremely helpful to see that that method would work
Richard
- RichPeppSep 27, 2019Copper ContributorEdit: I can use CheckOut if I can get find ItemID of the file but I haven't been able to get it from the manual trigger 'For a selected File'. If I pull the ItemID using 'Get file metadata using path' then I can use ItemID to CheckOut the file and all is well, but I haven't been able to get the ItemID of the file from the initial manual trigger. I'm sure this must be possible, I've just missed a trick somewhere
Thanks for your help
Richard- Norman YoungSep 27, 2019MVP
Hi RichPepp,
Use a variable to store the "FileId" and then "Get files" to get the related metadata. An snippet from a like Flow listed below.
I hope this helps.
Norm