Create and test an approval workflow with Microsoft Flow

With Microsoft Flow, you can manage the approval of documents or processes across several services, including SharePoint, Dynamics CRM, Salesforce, OneDrive for Business, Zendesk, or WordPress.

To create an approval workflow, add the Approvals - Start an approval action to any flow. After you add this action, your flow can manage the approval of documents or processes. For example, you can create document approval flows that approve invoices, work orders, or sales quotations. You can also create process approval flows that approve vacation requests, overtime work, or travel plans.

Approvers can respond to requests from their email inbox, the approvals center on the Microsoft Flow website, or the Microsoft Flow app.

Create an approval flow

Here's an overview of the flow we'll create and test:

overview of flow

The flow performs the following steps:

  1. Starts when someone creates a vacation request in a SharePoint Online list.
  2. Adds the vacation request to the approval center, and then emails it to the approver.
  3. Sends an email with the approver's decision to the person who requested vacation.
  4. Updates the SharePoint Online list with the approver's decision comments.

Prerequisites

To complete this walkthrough, you must have access to:

  • Microsoft Flow.
  • A SharePoint Online list.
  • Office 365 Outlook and Office 365 Users account.

Note

While we use SharePoint Online and Office 365 Outlook in this walk-through, you can use other services such as Zendesk, Salesforce, or Gmail.

Before you create the flow, create a SharePoint Online list; later, we'll use this list to request approval for vacations.

Create these columns in your SharePoint Online list:

SharePoint Online list columns

Make note of the name and URL of the SharePoint Online list. You'll need these items later when you configure the SharePoint - When an item is created trigger.

Create your flow from the blank template

  1. Sign into Microsoft Flow.

    sign in

  2. Select the My flows tab.

    select my flows

  3. Select Create from blank.

    create from blank

  4. Select the Create from blank button.

Add a trigger

  1. Enter SharePoint into the search box.

    search for sharepoint triggers

  2. Find, and then select the SharePoint - When an item is created trigger.

    select sharepoint trigger

  3. Select the Site Address and the List Name for the SharePoint list that your flow monitors for new items.

The Site Address and the List Name are the items you noted earlier in this walkthrough.

SharePoint info

Add a profile action

  1. Select New step, and then select Add an action.

    new step

  2. Enter profile into the Choose an action search box.

    search for profile

  3. Find, and then select the Office 365 Users - Get my profile action.

    select office users

  4. Provide a name for your flow, and then select Create flow to save the work we've done so far.

    save flow

Add an approval action

  1. Select New step, and then select Add an action.

    new step

  2. Enter approval into the Choose an action search box.

    search for approval

  3. Select the Approvals - Start an approval action.

    select the approvals action

  4. Configure the Start an approval card to suit your needs.

    Note

    The Title and Assigned To fields are required. You can use Markdown to format the Details field.

    configure the approval

Note

This action sends the approval request to the email address in the Assigned To box.

Add a condition

  1. Select New step, and then select Add a condition.

    add condition

  2. Select the Object Name box, and then enter response into the search box on the Add dynamic content from the apps and services used in this flow card.

  3. Select the Response token.

    select response token

  4. Select the Value box, and then enter Approve into the box.

    Note

    The valid responses to the Approvals - Start an approval action are "Approve" and "Reject". These responses are case-sensitive.

  5. Your Condition card should now resemble this image:

Add an email action for approvals

Follow these steps to send an email if the vacation request is approved:

  1. Select Add an action on the IF YES branch of the condition.

    add new step

  2. Enter send email into the search box on the Choose an action card.

    search for email actions

  3. Select the Office 365 Outlook - Send an email action.

    select send an email action

  4. Configure the email card to suit your needs.

    Note

    To, Subject, and Body are required.

    This card is a template for the email that is sent when the status of the vacation request changes.

    Note: In the Body box on the Send an email card, use the Comments token from the Approvals - Start an approval action.

configure approved email template

Add an update action for approved requests

  1. Select Add an action from the IF YES branch.

  2. Enter update into the search box on the Choose an action card.

    search for update action

  3. Select the SharePoint - Update item action.

    select update item

  4. Configure the Update item card to suit your needs.

Note

Site Address, List Name, Id, and Title are required.

update item configuration

Add an email action for rejections

  1. Select Add an action on the IF NO, DO NOTHING branch.

  2. Enter Send email into the search box of the Choose an action card.

    search for email action

  3. Select the Office 365 Outlook - Send an email action.

    select the send email action

  4. Configure the email card to suit your needs.

    This card represents the template for the email that's sent when the status of vacation requests change.

configuration for rejected requests

Add update action for rejected requests

  1. Select Add an action.

    add action

  2. Enter update item into the search box on the Choose an action card.

    search for update action

  3. Select the SharePoint - Update item action.

    select update item

  4. Configure the card to suit your needs.

Note

Site Address, List Name, Id, and Title are required.

update item card

  1. Select Update flow to save the work we've done.

    select update action

If you've followed along, your flow should resemble this screenshot:

overview of flow

Now that we've created the flow, it's time to test it!

Request an approval

Create a vacation request in the SharePoint Online list you created earlier.

After you save this request, the flow triggers, and then:

  1. Creates a request in the approvals center.
  2. Sends an approval request email to the approvers.

Now that you've created and tested your flow, be sure to let others know how to use it.

Learn more