Note: This article is part of a tutorial series on using PowerApps, Microsoft Flow, and Power BI with SharePoint Online. Make sure you read the series introduction to get a sense of the big picture, as well as related downloads.

In this task we'll create a flow that drives the process of approving projects. Microsoft Flow is integrated with SharePoint, so it's easy to create a flow directly from a list. The flow we'll create is triggered when an item is added to the Project Requests list. The flow sends an email to the project approver, who approves or rejects the request directly in email. The flow then sends an approval or rejection email to the project requestor and updates our SharePoint lists appropriately.

Step 1: Configure the flow template

  1. In the Project Requests list, click or tap Flow, then Create a flow.

    Create a flow

  2. In the right pane, click or tap Start approval when a new item is added.

    Create an approval flow

  3. If you're not already signed in, sign into SharePoint and Outlook, then click or tap Continue.

    Sign in to use template

    You now see the template for this flow, ready for you to complete. The boxes in the flow represent steps. They take input from previous steps, as well as input that you provide. Each step can then provide output to subsequent steps.

    Approval template

  4. In the Assigned To box, enter a name that is valid in your tenant.

    Approval email contact

    The next box in the flow responds to the project approver's decision and routes the flow to one of two branches: If yes or If no.

    Approval condition

Step 2: Create actions for Approve = yes

By default, this branch sends an approval email to the requestor. We'll also update the Project Requests list, and add an item to the Project Details list because the project has been approved.

  1. In the If yes branch, click or tap Inform item creator of approval, then Edit to see the default options for the email sent to the requestor.

    Edit email settings

  2. By default, an email is sent to the person who created the list item, with the subject line and message body that you see. You can update these if you like.

    Default email settings

  3. Click or tap Add an Action.

    Add an action

  4. Under Choose an action, search for "SharePoint", then click or tap SharePoint – Update item.

    Update item action

  5. Enter the SharePoint site URL and list name.

    Update item parameters

  6. Select the Id box, then click or tap ID in the dynamic content dialog box.

    List ID dynamic content

    Dynamic content is available throughout the flow, based on previous steps. In this case, the SharePoint list information is available, and we can use it in the actions that we create.

  7. Select the Title box, search for "Title" in the dynamic content dialog box, then click or tap Title.

    List title dynamic content

  8. In the Approved box, enter "Yes". This part of the flow should now look like the following image.

    List update

  9. Click or tap Add an Action again. This time we'll add an item to the Project Details list for the project that was approved.

    Add an action

  10. Under Choose an action, search for "SharePoint", then select SharePoint – Create item.

    Create item action

  11. Enter the SharePoint site URL and list name.

    Create item parameters

  12. Select the Title box, search for "Title" in the dynamic content dialog box, then click or tap Title.

    List title dynamic content

  13. Select the RequestId box, then click or tap ID in the dynamic content dialog box.

    List ID dynamic content

  14. In the PMAssigned box, enter "Unassigned". This part of the flow should now look like the following image.

    Create item complete

Step 3: Review action for Approve = no

By default, this branch sends a rejection email to the requestor. We'll also update the Project Requests list. The project isn't moving forward, so we don't add an item to the Project Details list.

  1. In the If no branch, click or tap Inform item creator of rejection, then Edit to see the default options for the email sent to the requestor.

    Edit email settings

  2. By default, an email is sent to the person who created the list item, with the subject line and message body that you see. You can update these if you like.

    Default email settings

  3. Click or tap Add an Action.

    Add an action

  4. Under Choose an action, search for "SharePoint", then click or tap SharePoint – Update item.

    Update item action

  5. Enter the SharePoint site URL and list name.

    Update item parameters

  6. Select the Id box, then click or tap ID in the dynamic content dialog box.

    List ID dynamic content

  7. Select the Title box, search for "Title" in the dynamic content dialog box, then click or tap Title.

    List title dynamic content

  8. In the Approved box, enter "No". This part of the flow should now look like the following image.

    List update

  9. At the top right of the screen, click or tap Create flow, then Done.

    Done button

    The flow is now complete, and it should look like the following image if you collapse the boxes.

    Completed flow

Step 4: Run the approval flow

  1. In the Project Requests list, click Quick Edit and add an item like the following:

    • Title = "New monitor for Megan"
    • Approved = "Pending"
    • Description = "Megan needs a 24" monitor"
    • EstimatedDays = "1"
    • ProjectType = "New hardware"
    • RequestDate = "02/03/2017"
    • Requestor = "Megan Bowen"

    Item added to list

  2. Click Done at the top of the page when you're finished.

    Done check mark

  3. Check the inbox of the approver's email account. You should have an email like the following.

    Email to Allan Deyoung

  4. After you click Approve or Reject, the flow runs another process, and you get feedback like the following, directly in the email.

    Approval action complete

  5. The flow sends an email to Megan with Allan's response, as in the following image. This email comes from Megan because she owns the flow.

    Email to Megan Bowen

Next steps

The next step in this tutorial series is to create an app to manage projects.