Forum Discussion
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 document is locked during the approval process so it can't be altered ie. that all the people who are approving the document know that they are approving the same thing.
I can think of a few ways that this might possibly work e.g. locking the document so it can't be edited or referring the approval to a particular version of the document so you know if it has been altered or not. I was even wondering about pushing the version along with approval history into a new column to make it easier to track. I'm struggling to find any way of achieving this using Flow but I suspect it is because I am doing this in the wrong way.
For reference the files I am trying to approve are in a document library, that document library has been set for Content Approval rather than Request Sign Off flows and I am trying to use an instant flow so that users will pick the appropriate approval flow when it needs to be done.
I realise that signing a document might be an alternative whereby I know that the document hasn't been changed since it was signed but then I get into the more difficult realm of managing certificates for people who have signed it. Flows seem nice, elegant and easy for my users to manage if I can get change control under, well, control
Thanks for any help or advice on this
Richard
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
6 Replies
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
- RichPeppCopper 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
- RichPeppCopper 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