SOLVED

Locking a file for approval

Copper Contributor

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

6 Replies
best response confirmed by RichPepp (Copper Contributor)
Solution

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.

Capture.PNG

Once approved the Status is set to "Approved" and the "Check out" is discarded.

Capture1.PNG

If rejected, the Status is set accordingly and the "Check out" is discarded.

Capture2.PNG

 

Here is the Flow I used:

Capture3.PNG

 

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

 

 

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

Edit: 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

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.

Capture.PNG

I hope this helps.

 

Norm

Hi @Norman Young 

 

That's quite a clever way of doing it, I'll give it a shot.  I had tried GetFiles but had got stuck on the filtering.  I'll see if your trick helps

@Norman Young 

And it works!  Thank you very much for that trick, I don't think I would ever have found it on my own as it was just one step removed from what I was expecting to have to do.   I can now check the file out successfully so I should be able to work on the rest of the process now

 

Thanks again and best wishes

 

Richard

1 best response

Accepted Solutions
best response confirmed by RichPepp (Copper Contributor)
Solution

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.

Capture.PNG

Once approved the Status is set to "Approved" and the "Check out" is discarded.

Capture1.PNG

If rejected, the Status is set accordingly and the "Check out" is discarded.

Capture2.PNG

 

Here is the Flow I used:

Capture3.PNG

 

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

 

 

View solution in original post