Automating a common manual process in Office 365 is easier than ever with Microsoft Flow. We will dive right in and create an approval workflow for the review, approval, and classifying a blog as “ready to submit.” Here is the basic workflow for our process that we’d like to automate.
There a couple different ways to enter in to the Flow designer.
- From flow.microsoft.com
- From a SharePoint Document Library
- From the Teams
In this example, we are going to create a workflow from scratch straight from a SharePoint Online document library. The benefit of starting the workflow from the document library is that the Site URL, list GUID, and other contextual information is automatically pulled into Flow.
From the document library, select Flow > Create a Flow > Request Manager Approval for a selected item.
You will be redirected into the Flow application to begin editing the workflow.
At the bottom of the template overview page you’ll see what connectors this template is configured to use out of the box. You’ll find that the “Request Manager Approval for Selected Item” Flow template already is configured to integrate with SharePoint Online, Office 365 Users, Appovals, Emails, and Notifications.
The template comes pre-configured with the following steps:
- For the selected SharePoint Item
- Get the Item
- Get my user profile
- Get my manager
- Start an Approval process
- Condition (based on approval decision)
- If Approved (inform requestor)
- If Approval Denied (inform requestor)
If the get manager action fails, the workflow will send an email to the document creator and terminate the workflow. If the get manager action is successful, it will start an approval sub process.
Based on the outcome of the approval process (approved or denied), the workflow will alert the requester to the manager decision.
Each of the previous steps output certain variables that you can use in the current step. So, if we want to add more information about the SharePoint document library item in the alert email, we can click in the Email Body field then select Add Dynamic Content.
As you can see, we have these 6 items returned from the “Get Item” workflow step. We can add any of these to the email alert body. One thing to not do here is that if you select a multi valued array of data, like “Shared with Display Name,” it wraps the “Inform requester of approval” step inside of each loop, effectively emailing multiple times.
We are going to add more more step to the end of this to update the status field to “Ready to Submit.”
Click on New Step at the bottom. Then select Add an Action.
Click on SharePoint to filter the available actions provided by the SharePoint connector.
We would like the workflow to update the Status field, so we’ll select SharePoint – Update item.
Now select your SharePoint Site URL. You’ll see, however, that the List Name is not available. You can use the GUID from the Get Item workflow step above to fill in here. You’ll need to select Enter custom value and then paste the list GUID in.
For the ID field we are going to use the ID variable of the Get Item action.
And finally, we’ll have the workflow update the Status field’s value to Ready to Submit.
Let’s save the workflow and head back to SharePoint to test it out.
In our document library now, if we highlight a list item and select Flow > Request manager approval for a selected item, you’ll see a panel appear at the right.
Based on the design of the work flow it now asks the user to enter a message to their manager.
The manager will get an email from Microsoft Flow and the select Approve or Reject and then Submit.
After the approval is processed we can refresh the document library and you’ll find our item Status field was updated.
If you did not change the workflow name from the default you can easily do that by going back to the Flow interface and click edit flow. Then just type in the new name and click Update Flow.
Microsoft has provided some very useful templates right from the start for you. Most processes in organizations require some type of approval and this template can be a great launching point for you to start automating those processes!
Stay tuned for more posts in the future on PowerApps and other solutions in Office 365.
Let’s discuss your unique needs!
You can print it out for a handy reference!