Create an approval flow
Here's an overview of the flow we'll create and test:
The flow performs the following steps:
- Starts when someone creates a vacation request in a SharePoint Online list.
- Adds the vacation request to the approval center, and then emails it to the approver.
- Sends an email with the approver's decision to the person who requested vacation.
- Updates the SharePoint Online list with the approver's decision comments.
Create your flow from the blank template
-
Sign in to Microsoft Flow.
-
Select the My flows tab.
-
Select Create from blank.
-
Select the Create from blank button.
Add a trigger
-
Enter SharePoint into the search box.
-
Find, and then select the SharePoint - When an item is created trigger.
-
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.
Add a profile action
-
Select New step, and then select Add an action.
-
Enter profile into the Choose an action search box.
-
Find, and then select the Office 365 Users - Get my profile action.
-
Provide a name for your flow, and then select Create flow to save the work we've done so far.
Add an approval action
-
Select New step, and then select Add an action.
-
Enter approval into the Choose an action search box.
-
Select the Approvals - Start an approval action.
-
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.
Note
This action sends the approval request to the email address in the Assigned To box.
Add a condition
-
Select New step, and then select Add a condition.
-
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.
-
Select the Response token.
-
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.
-
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:
-
Select Add an action on the IF YES branch of the condition.
-
Enter send email into the search box on the Choose an action card.
-
Select the Office 365 Outlook - Send an email action.
-
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.
Add an update action for approved requests
-
Select Add an action from the IF YES branch.
-
Enter update into the search box on the Choose an action card.
-
Select the SharePoint - Update item action.
-
Configure the Update item card to suit your needs.
Note
Site Address, List Name, Id, and Title are required.
Add an email action for rejections
-
Select Add an action on the IF NO, DO NOTHING branch.
-
Enter Send email into the search box of the Choose an action card.
-
Select the Office 365 Outlook - Send an email action.
-
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.
Add update action for rejected requests
-
Select Add an action.
-
Enter update item into the search box on the Choose an action card.
-
Select the SharePoint - Update item action.
-
Configure the card to suit your needs.
Note
Site Address, List Name, Id, and Title are required.
-
Select Update flow to save the work we've done.
If you've followed along, your flow should resemble this screenshot:
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:
- Creates a request in the approvals center.
- 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.