Google Drive document approvals

In this example, we will set up a flow that watches for new documents in our Google Drive “Before Approval” folder. Each new document added to the folder generates a new human task for a manager to manually approve the document. This task will be sent to the manager’s email address as an email with two buttons – "Approve" and "Reject" – together with a link to the document.

Once the manager approves it, the document will be copied to the Google Drive “Approved” folder. If the manager rejects the document, it will be copied to the “Rejected” Google Drive folder. At the same time, a Slack notification is sent to a channel with the resolution.

Seems like a lot of work? Not with Appmixer. Let's get started!

Before we uncover all the steps required to build such a flow, let's start from the end and see what the flow looks like in Appmixer when it's complete.

Let's see how we've built the flow from scratch. First, we need to set up the trigger. In this case, the flow starts every time a new file gets uploaded to the "Waiting for approval" folder in our G-Drive.

We want to notify the approver via email. Therefore, we need to use the "RequestApprovalEmail" component under the "Tasks" module. As said earlier, this module makes sure the relevant person receives an email where he or she can easily approve or reject the document. First, we set the Task title and Description.

Next, we need to define the Requester and Approver emails.

Last but not least, we need to set the "Decision by" date. Here, we will use Modifiers and will set the due date to the time the document was created + 24 hours. In other words, the approver has 24 hours to approve the document after it's been uploaded to the "Waiting for approval" folder.

Notice there are three paths from the Tasks component: approved, rejected, and due. As the names suggest, "approved" sets the path once the document gets approved, "rejected" allows you to set a different path in case the document gets rejected, and "due" helps you adjust the flow when the task is due. In our case, we want to notify the approver via SMS.

When the document gets approved, we need to export the relevant file from our G-Drive and upload it to the relevant folder.

Moreover, we want to send a Slack message every time a document gets approved.

Notice how we've used Variables throughout the setup. Thus, we will make sure the flow works with the right file throughout the execution, and we get a notification on Slack with a better context (using the file name and web link in the message body).

Now when the "Approved" path is set, let's finalise the "Rejected" path. To save you a little bit of time, see the already set up path below. Needless to say, the process for similar to setting up the "Approved" path.

As stated above, we want to notify the approver via SMS when the task is due. This way, we reduce the risk of tasks being forgotten.

We're all set now. When we start the flow, upload a file to the "Waiting for approval" folder and the file gets approved or rejected, we should see in the Logs that the flow runs successfully.

You may wonder, how does the approver approve or reject the documents? Glad you ask. In this case, the approver can either hit the "Approve" or "Reject" button in an email that is sent as part of the "RequestApprovalEmail" component...

... or he or she can visit the "Tasks" dashboard where she sees all the tasks.

As you can see, instead of logging into a G-Drive account, finding the right folder, opening a document, and then moving it into the right folder (Approved or Rejected), the approver hits a single button and Appmixer takes care of the rest. Simple, yet very powerful.

Last updated