Work smart - automate those pesky approvals processes
In this example I show how a beginner level script can help you initiate and close out a request for approval on a document.
The Approval Work Flow
So you're done with that multi-page report / document, and you're looking for a quick way to get your manager to review and sign-off on it. In the following section I'll show you how you can set up a simple Flow that will manage the authorization process for you. It assumes that you send files to the same person for authorization, which you can change at any time. Let's get started.
The first part requires that you set a site address (somewhere on SharePoint where you'll be working regularly). If you often work in a specific Team then the corresponding site will be the right choice for you. The steps are activated from SharePoint - clicking on a file and choosing "Flow" and selecting the name of this Flow. It gets the details of the selected file and asks a basic question of whether the File is Approved or not.
If the file is already approved we can end the process here, but if not, then we want to start the approval process. Here's how you do that.
With the following tiny expressions to help in the process:
Contents of Compose: if(equals(body('Start_an_approval')?['response'],'Approve'),'Approved','Rejected')
Contents of Item Link: replace(body('Get_file_properties')?['{Link}'],' ','%20')
Before you save the script, be sure to change the To fields in the Approval step and the Email step to show your manager and you respectively.
Finally, we could do a couple of more things after this like changing the file status to approved, or even spinning up an entirely new process for emailing the approved file. But for now, we'll leave this one here.
Using the Flow
Now that the Flow has been created, we'll want to use it.
- Navigate to the SharePoint folder where you've stored / been working on your file.
- Click the three dots to the right of the file.
- Click on Flow (then wait a minute while it finds all the flows available).
- Click on the Flow that you've just created, you'll be prompted on the Right hand side of your screen to enter some details and then run the flow.
- Next the recipient will get an email which they can choose to approve / reject, and you will receive a copy of the response as an email too.
That's it! You're done and on your way again to never having to type another request for approval email to your manager!
Wrapping Up
I hope this post has helped you get on top of another tedious task. This is just one of a series of automation related posts I'll be sharing over the next few month. Please, if you found value in this post, Follow me on LinkedIn and encourage your colleagues to do the same.
If you have an automation challenge at work that you'd like to see solved, leave a comment below and I'd be happy to post a solution as part of the series.