Making a vacation request flow with Microsoft Flow (preview)

Last week I was watching the Future of SharePoint event and it got me thinking about all the amazing new opportunities there are for developers, end users and also power users. During my time working as a SharePoint Developer I usually got a lot of questions from for instance HR departments about workflows. They weren’t able to create workflows themselves, so normally the question got to me.

Working with SharePoint Workflows wasn’t really bad, but I wished there was some tool I could give to them and to help them create these workflows themselves. I’ve heard from Microsoft Flow, but didn’t had the chance to try it out myself. Until today….

What is it I want to solve with Microsoft Flow?

I would like to create a workflow to streamline the HR Process to request a vacation. Lots of companies have a system like that, so I can imagine it would be great to have it in SharePoint / Office 365. The flow I want to make is the following:
1. An employee adds a list item with the dates of the vacation
2. The manager gets pulled from the user profile
3. An approval email will be send to the manager
4. The manager has the option to approve or deny the vacation request
5. Depending the choice of the manager an email gets send to the employee
6. The status field in the list item will be updated

First things first. Let’s start with Microsoft Flow. You can get there by going to https://flow.microsoft.com or by clicking on the Flow-tile in the app-launcher.

To start building a flow you need to click on ‘My flows’ at the top left of the site and then you have to click on the ‘Create from blank’ button.

When you clicked on that button the first thing you will see is a search box with the text ‘How would you like to start’. There are loads of actions to select from. I want the employees to create a list item in SharePoint so I will select ‘SharePoint Online – When a new item is created‘.

To create a connection between your flow and your SharePoint Online environment you have to make sure to click the sign in button and log in. Next you can fill in a site URL and a list name. I made the HR Requests list earlier to make sure everything is in the right place.

Now we have the first step of our flow ready. Easy right? To get the manager we have to click the + button beneath the box we just filled in and add an action. We have to select the action ‘Office 365 Users – Get manager’ and sign in again, just like the previous step. After that you have to select the ‘Created By Email’ button to make sure this step will get the manager of the user who created the list item.

The next step in the flow is sending an approval email to the manager. This is an action called ‘Office 365 Outlook – Send approval email’ and you should fill it out like the image below.

This step will make sure the manager gets an email when the employee files a vacation request by adding a list item. For the next step we will have to add a condition. When we set this up correctly, depending on which choice the manager picked, our flow will perform an action. A condition is different from an action. Because we chose the user options ‘approve’ and ‘reject’ in the previous step it’s a good idea to make these options part of the condition. There are only two user options so this will make it easy for us. Make sure the condition & the actions look the same as the following screenshot to send an email to the employee when the manager responded to the approval email:

We have one more step to do to complete all the steps of our Flow. We have to update the list item the employee created so the correct status is displayed. To make this happen we have to add an action below the condition with the send email actions. Choose the ‘SharePoint Online – Update Item‘ action from the list with actions and fill in the options like the image below.

To make sure out flow will run, we only have to fill in a flow name and click on the ‘Create flow’ button on the bottom of the page:

The flow is now created and it will pick up almost instantaneously when the starting action is performed.
To see this flow working I will have to add a list item to the list called ‘HR Requests’.

List settings

But first I have to explain something about the list. It’s a custom list with one content type. The following fields are added to this content type:

The column ‘Vacation request status’ has ‘Pending’ as a default choice and has ‘Approve’ and ‘Reject’ as other options. I also made three different views in the list to divide the list items in these three options. This makes it easier for the employee to see which items are approved, rejected and pending.

Will it work?

Let’s make a list item to see how everything looks.

I almost immediately receive the following request by email:

Of course I would like to go to Maui, so let’s click the approve button! A new browser window opens and the following message appears:

Not more than a couple of seconds later I receive the following email:

Final thoughts:

I think Microsoft Flow works pretty good for now. It is pretty mature for a preview with all those actions. Things I would like to see in the future:

  • A way to skip the first step with the site URL and the list name. When Microsoft Flow will be completely integrated in SharePoint I wouldn’t like to fill in the site URL and the list name because it already should know where I was when I click the flow button.
  • More drag and drop compatibility. Power users at a lot clients I work for would love that kind of functionality.
  • Categorization of the actions. I would like to see this done by service (MailChimp, Office 365, Instagram etc), because I can imagine the list will get very very very long…
  • Co-creation. I think a lot of power users would like to create flows as a team. That would be a great improvement! I just want to say: kudos to the Microsoft Flow team for putting together such a great tool! I look forward to the next steps!

Comments

comments powered by Disqus