Automate HR processes using Microsoft Teams, PowerApps and Power Automate. Employee withdrawal requests

Good day to all! Today I would like to share a small example of automation of the process of creating applications for new employees using Microsoft SharePoint, PowerApps, Power Automate and Teams. When implementing this process, you will not need to purchase separate PowerApps and Power Automate user plans, an Office365 E1 / E3 / E5 subscription will suffice. We’ll create lists and columns on the SharePoint site, PowerApps will help you create the form, and Power Automate will provide the ability to customize the logic of business processes. The final process is connected to the MS Teams team. Let's not waste time and see what happens.



At the first stage, we create lists and details. We will need lists:

  1. Employee withdrawal requests
  2. Divisions
  3. HR by unit
  4. Administrators

Each list will play a role in the future, and we will see which one. We create the details and configure the navigation menu:



Powerapps


Now, let's make a form for the Employee Withdrawal Applications list using PowerApps. In the final form, it will look like this:



In the “Employee” field, Office 365 users are selected from the list of users, “Release Date” is indicated from the calendar, “Department” is indicated from the departments directory, and “HR” is selected from the “HR by departments” directory :



But you need to make sure that the list of HR available for selection is filtered by the unit indicated on the form. Use a formula to filter data in PowerApps. For the “Items” property of the “HR” field, we write:



Additionally, on the form, you can make small settings for the default value for the Status field. For the “Default” property of the “Status” field, write:



If the item creation form is opened, then the “New” value will be written in the Status field; otherwise, the value from the SharePoint column for the current element will be substituted into the status field on the form.

One of the problems with PowerApps is the inability to easily retrieve data from SharePoint groups. In this regard, it is not possible to easily configure the visibility / availability of fields or objects on the form if you wanted to tune in to the user's joining the SharePoint group. But you can make a workaround. Especially for this, we have created a list of Administrators in advance:



In this list there is an “Employee” field with the type “User or group” displayed only on the form and a “Name” field in which the name of the selected employee is written, displayed only in the list view. Now, let's do a little trick in PowerApps. For example, you can configure the availability of any field to the condition that the current user is in the Administrators list. We find the “Display Mode” property of the “Release Date” field and write:



According to this formula, if there is at least one employee in the Administrators list whose login matches the login of the current user, the field will be available for editing, otherwise, for viewing. For greater reliability, we bring the login to lowercase, otherwise there are all sorts of cases.

You may have noticed that there is a button “Actions on application” in the title of the form:



This button will go to another screen, where, for convenience, all possible actions on the application are collected:



After clicking on each button an additional window of actions is opened, for example, if the action "Cancel request" is selected, an additional window opens with the ability to enter a comment:



After clicking on the “Confirm” button, the status of the application changes, and this can be done even without starting the Power Automate stream. We will use the “Patch” function for the “OnSelect” property of the button:



Using the Patch function, we update the application list item by filtering it by the identifier of the current item. We change the value of the "Status" field and go to the main screen. For the remaining action buttons, the logic is similar.

It remains to configure the negotiation flow. Let's make it in its simplest form.

Power automation


Our approval flow will start automatically when you create an application. During the implementation, the status of the application will be changed, the division head will be received, and a notification of a new application will be sent to the head. To determine the leader, we have a directory of “Departments”:



We create a Power Automate stream:



During the execution of this stream, the head of the division receives an email notification about the creation of a new application and can click on the link to make a decision by clicking on the button:



Clicking the “Agree” button or “Reject” also triggers the Power Automate thread, which changes the status of the application and sends a notification email to an HR specialist:



The process is ready.

Teams


And the final touch is the organization of collaboration with this process. To do this, we connect the process to the MS Teams team:



Now, all members of the MS Teams team have access to the new employees exit process on a separate tab.

Of course, multi-stage matching can be provided in the flow logic, plus there is the possibility to use the Approvals component to assign Power Automate tasks. You can also set up reports and generate notifications that will be sent to the Microsoft Teams chatbot. But more on that in the following articles. Thank you for your attention and have a nice day!

All Articles