In this blog, I will discuss how to create a leave request approval app using PowerApps and Flow in office365. I have created a generic/custom list in office365 named “Leave Request” which contains the columns mentioned below.
- Description Multiple lines of text
- Leave Type Choice
- Leave Status Single line of text
- Email Single line of text
From these Email and Leave Type columns are required field. Now we will discuss how to create an app using PowerApps Studio and an approval process using Flow. The Leave Status column will be updated as Approved or Rejected after the completion of the approval process by the approver also an email of the leave status will be sent to the mentioned email in the email column.
Create an app for Office365 Custom List using PowerApps
In this section, we will discuss how to create an app for our office 365 custom list using PowerApps.
- We will navigate to the custom list (Leave Request) in Office365 site. For example, https://softreetechnology.sharepoint.com/Lists/Leave%20Request/AllItems.aspx
- We will click PowerApps and then click “Create an app”.
- We will enter the app name and then click “Create”.
- By default, the generated app contains Browse, Detail, and Edit screen. We will Navigate to the Edit screen, select Leave status card and then select a visible property in the property box. Set visible property value to false in the formula bar so that “Leave Status” field will not be shown to users.
- Save and publish the app.
Create the leave approval process using Flow
In this section, we will discuss how to create the leave approval process using Flow.
Navigate to the custom list (Leave Request) in SharePoint Online site. For example, https://softreetechnology.sharepoint.com/Lists/Leave%20Request/AllItems.aspx
We will Click Flow and then click Create a flow.
We will Click See more templates.
We will Search for SharePoint and select SharePoint – When an item is created.
We will Enter the URL and select the list name from drop down. Click New Step.
We will Click New Step and then click Add an action.
We will Search for Start and wait for the approval. Then assign any user email from the organization and also provide the item link and item description.
Then we will Click Next step and then click Add a Condition according to the response from the approver.
If yes then we will send the leave status and the message to the user who applied for leave and also updates the leave status field in the leave request list.
For the above step, we will select Office 365 Outlook – email.
We will Fill in all the required details.
We will add an action to update the Status field to Approved.
We will Search for Update Item and then select SharePoint – Update item.
If the condition is not satisfied, add an action to update the Status field value to Rejected. Enter the name for the flow and click Create flow. Flow created successfully. Click Done.
Testing the app and leave approval process
Open the Leave Request App which we have created
Click “+” icon to create new item. Enter the details and click tick icon. Item is created successfully. Approver (I have added myself) will receive an email to approve or reject in Office 365 Outlook. Click “Approve”. Navigate to list and you could see the Status field got updated to Approved. You can log in to the email given by the user and able to see the status of the leave in the email.
In this article, we saw how to create a leave request form app using PowerApps and also an approval flow using Microsoft Flow in Office 365.
This solution is brought to you by our SharePoint professionals.
Softree Technology employs SharePoint consultants; we are a technology services provider with the aim to help companies achieve exceptional performance through SharePoint. Our dedicated team of SharePoint consultants has the right bent of mind to understand and execute customer requirements.
Be it SPFx or SharePoint add-in developments, SharePoint 2019 developments, web part developments, migrating from SharePoint 2010/2013 to SharePoint 2013/2016/Office 365, Office 365, SharePoint hosted apps development or something else in SharePoint, we strive to deliver the best