For a big team, it’s essential to have control over the time-off or holidays that each takes. Each person has his/her allowances, and some need approval. In most cases, this process is manual by sending an email to a manager or registering the intention in an Excel file. It’s time-consuming, and our friends Flow, and SharePoint can automate most of this for us.

You can check my YouTube video and article that I wrote a few weeks ago approaching this topic.

For this demo we’ll do the following:

  1. Create a SharePoint list with people, time that they can take off and a manager
  2. Create a SharePoint list with requests
  3. Have flow fetch them and send an approval request to their manager
  4. Register the manager’s answer in the requests list
  5. Send an email to the person with the reply and comments.

Looks complicated but it’s not. Let’s start

Create the SharePoint Lists

If you don’t know how to create lists, I have a step-by-step tutorial on how to do it and the best practices to create them.

Employee

Disclaimer: Since I only have one person in my account (myself), I need to cheat a little. I need to create a column with the email so that I can send it to test. While building this, define the person as type ”Person” and the boss as ”Person” also. Then you can have access to the email and other useful information.

The columns are:

  1. Title – The name of the employee (in your case this can be anything since you’ll get the information from the person)
  2. Boss – Who to send the request
  3. Boss email – You won’t need this because you’ll have this in the person, but I need to add the additional field to make my life easier.
  4. Remaining Days – How many days the person has left
  5. Person – The Office 365 user
  6. Email – See disclaimer above

Now let’s create the requests list:

The columns are:

  1. Title – We’ll use this to write what’s happening
  2. Person – Lookup to the employee table. The person who’s asking
  3. Person Remaining Days – Having the additional field here allows us to fetch the file directly and not have to get the item in the “employee” list
  4. Status – Status of the request
  5. Requested Days – How many days off?

Simple. Now let’s create the flow:

Flow time

Now let’s start having some fun. The Flow is quite simple, but let’s break it down into small steps to explain it better.

First, the trigger monitors if there’s any new item in the “requests” list. If there is we find the employee in the employee table by searching by ID and limiting the return to 1 since we’ll always have only one person with the same ID.

Next, let’s check the remaining steps.

There are three possibilities:

  1. There aren’t enough days. Then it’s rejected, and the requester notified
  2. There are enough days. The approval process is triggered and updates with the outcome:
    1. The manager rejects
    2. The manager approves

Let’s run all three possibilities and check if all works fine.

Testing

Let’s do some tests to ensure all parts of the approval process are working correctly. To test, insert a new value in the “request” list, and it will trigger the flow automatically.

Test 1: Ask for too many days

Let’s ask for 30 days.

We get an email right away:

Let’s check SharePoint:

It works!!!

Test 2: Ask for enough days and boss rejects the request

Lets’s ask for five days off

The boss receives the email:

But rejects it:

Let’s check SharePoint:

Good!

Test 3: Ask for enough days and boss accepts the request

Same steps as before but different reply.

Let’s check SharePoint:

Final thoughts

I tried to create a simple example that demonstrates the power of approval processes built in Flow with only a few steps. You can then create additional steps, add multiple people to the approval process, notifications, etc.

Have a suggestion of your own or disagree with something I said? Leave a comment or interact on Twitter and be sure to check out other Flow-related articles here.

Featured Image by Katya Austin on Unsplash

Manuel Gomes

I'm a Project Manager with experience in large projects and companies. I've worked in the past for companies like Bayer, Sybase (now SAP) and I'm currently working for Pestana Hotel Group.

View all posts by Manuel Gomes →

Leave a Reply

%d bloggers like this: