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.


Create your flow from the blank template

  1. Sign in to 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

    ToSubject, 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 AddressList NameId, 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 AddressList NameId, 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.