PowerApps is part of O365 and Dynamic 365. It is an easy-to-use tool for building business applications. It allows you to create Mobile Apps that run on Windows (Modern Apps), Android, iOS and with browsers. It is has native integration with many tools from O365 family including Microsoft Flow or Power BI and connects to many data sources, like SharePoint, OneDrive, Dynamics and more. Check out the licenses price plan from Microsoft.
I am an experienced software developer and I have developed many PowerApps for the clients of EFEXCON so far. However, I would like to form that Blog Post from the perspective of a casual user who just want to start the adventure with PowerApps and discover how it looks like to create own application from the existing templates.
Someday I wanted to check if the templates proposed in PowerApps might be useful for EFEXCON’s internal purposes. While reviewing the templates, one caught my attention and evoked memories. I thought I would take a closer look at it. Leave Request is an application in which an employee can request a vacation or report absence due to sick leave, etc.
Memories – a description of the problem
In one of the companies where I worked previously, the leave request was done in a rather primitive way. I had to go to the manager, take a special card, fill it out, ask for approval and signature. After successful approve the leave request, I had to go to the human resources department and leave the print there. A simple procedure. However, when the manager has left somewhere, and the HR department is located at the far end of the second building, in practice it could take a lot of our valuable time. Imagine how much time a company loses when we multiply it by the number of employees in the company several times a year.
Cards – you ask? Impossible! Unfortunately, many companies are still working this way. Over time, someone will come up with the idea to solve this problem. He will say: create a tailor-made application, perfect for our company, without any notes! How much would it cost to implement such a simple application? Requirements analysis, custom architecture, interface design, creating an interface, implementation of functionalities, some database, tests, feedback, bugs, fixes. It’s a simple thing, but it will consume a lot of time and money, so maybe we will stay with the cards…
There are ready-made solutions! Just look around the market and buy a license. However, it sometimes happens that a ready solution does not fully meet our needs. What if there were ready-made solutions that we can additionally modify according to our wishes?
PowerApps! The template I mentioned at the beginning. To create an application, you only need a few clicks in theory. For sure? Look!
Installation of a template
1. Let’s see what Leave Request offers. Let’s create an application based on a template.
2. The application will ask for permission for the following services.
3. Unfortunately, the first issue appeared. The application cannot download data from OneDrive. We will check OneDrive. No files have been created there. Should we create them ourselves?
4. There is another message: “Make your own version of this app by connecting to data storage, such as OneDrive”. Click “Make my own app” button and we’ll see what happens.
It seems a little strange. We create the application for ourselves, our own version, based on the template, the entire structure is built. What is the purpose of that message and this button for re-creating your own version?
5. The application asks where I want to store data. There are many data sources to choose from. I will choose “OneDrive for Business”. Another strange thing. The application has already asked for permission to OneDrive, and here again asks where you want to store the data. If I chose Dropbox or Google Drive, why do it need OneDrive permissions?
6. The application has been reloaded. Again, we were asked to give the same rights.
7. Unfortunately, the same error is still there. ClientRequestId has changed. There were also duplicates of data collections. At the place where the error occurred, change the data source to refresh. So, let’s choose Leave_1 for example. The error has disappeared! The newly created connections are correct. You only need to replace every instance of connectors in a formula, which is probably a bad idea.
8. Let’s check if something appeared on OneDrive. Yes! The entire directory structure and the excel file have been created.
9. What does the file contain? Three sheets with names such as connections to data sets. BINGO!
10. What if you add data links again? The links will contain the correct name and point to the existing file. It should work. Let’s try! Let’s delete existing connections to OneDrive.
11. Let’s add again pointing to the file. Click “Add data source”.
12. Then choose OneDrive for Business.
13. We choose the appropriate folder and file.
14. We select sheets and click Connect.
15. It looks good. Save the application and run it in view mode.
1. What’s next? We see two options to choose from. We can log in as an employee or as a manager. Log in as an employee.
2. We can add our first holiday request.
3. At this point, another error message.
4. It looks like I haven’t configured the manager. For what? We can assume that it is needed for the “Submit request to” field. We can check it. To do this, go to the application editing mode. There we’ll recreate login steps. After re-entering the steps, an error in the form of a yellow exclamation icon appeared at the stage of creating the request. After clicking, it moved us to the formula. There, by scrolling through the lines of the formulas, we find an error. The formula in which the error occurred was trying to get the manager’s ID, which would later be assigned to the variable NewLeaveApproverId. The name suggests that our assumptions were correct.
Note: the manager field is a standard field in Azure Active Directory.
5. Let’s see where this variable is used. Let’s move to variables.
6. In the Uses tab, we see three text boxes to which the values returned by the formulas are assigned. The NewLeaveApproverID variable is not directly assigned but is used to download other user values such as Job Title, Display Name and Photo.
7. Click on one of the fields on the list. It moved us to a set of NewRequestContent3 fields.
8. We can find here three text boxes that belong to the “Submit request to” section. This confirmed our assumptions.
9. Because I haven’t set a manager for my test user, this field was not automatically set, but it does not matter. We can do it manually. Let’s get back to the application. The error message should disappear after a while.
10. What a nice transparent interface. Well, let’s choose the type of vacation, time interval, person responsible for processing the application, title, short description. In addition, the number of days remaining and the number of days of the current holiday are displayed. You do not have to think about how many days you have been off.
11. After submitting the request, we see a confirmation screen.
12. We have been moved to the main screen. We can see the added request with the current status.
13. From the menu on the left you can view our current balance.
14. In addition, we have a list of free days in the company.
15. And a piece of documentation.
1. Let’s switch to the manager’s account.
2. On the main screen, we see a request for leave from one of the employees, which we can immediately approve or decline.
3. Additionally, the manager receives an email:
4. Perform a commit.
5. We can also send a feedback message to the employee in the form of an email.
Employee mode again
1. As an employee, we can see in the app that requested the vacation changed the status (meanwhile, I added one more).
2. The balance of available days has also changed.
It works great!
I mentioned at the beginning that the application can be adapted to suit your needs. What would I change?
1. I would improve the management configuration error.
2. I would remove some types of leave and replace others. for example, I would replace the Jury of Duty with maternity leave.
3. I would also change the number of vacation days available for start. How to do it is described in the simple application documentation available during editing.
4. I would provide a second version of the application in German but using the same file.
5. I would create a mobile version of the application.
6. I would add functionality that would add leave in our calendar and in the company leaves calendar.
7. If I would still be working in the previous company (with old school processes) and want to encourage those folks to use that PowerApp, I would adjust the workflow to the following:
- Employee sends requests
- Manager approves the request
- The notification about approved request is forwarded to the HR department
8. Storing data in an Excel file, although very comfortable, has a serious disadvantage. The application works in the context of the user, that is why the user must have the right to edit the Excel file, which is not good because the same access to the file itself. I know the reason might be to ease the usability and lower the maintenance cost, but using a classical DB approach might be a bit more secure.
9. I would block the possibility to log in as a manager for regular employees! Logging in as a manager should only be allowed for a relevant group of users, eg Managers or Leave Request Approvers.
The application needs some time for initial setup. For beginner users it might be confusing, but if someone already has some experience with PowerApps it will be a piece of cake.
We may wonder if these issues can be avoided? Should creators prepare a template better? In my opinion, yes. Duplicating connections or not creating an Excel file when asking for OneDrive permissions should be improved. However, the error regarding the lack of configuration of the manager on my account is my fault. I worked on the test tenant. Although, in my opinion, this information should be conveyed in a different way, with a clear message what is wrong, what should be done to be ok and why. However every IT Professionals should easily associate the term field manager with the Active Directory 😉
After all, I checked if others had similar issues. You can read about it here.
I rate the application very good and useful. After its configuration, it will certainly improve a range of activities in the company and simplify the life of employees. It will save you some time. The collected data can be easily analyzed using, for example, Power BI in terms of holidays or sick leave, which in turn will allow for proper planning of the company’s activities.
I would like to add, that the template used is a good example for building applications in PowerApp. It clarifies the operation of certain PowerApp mechanisms during learning.
I hope, that the tutorial will be useful for beginners in creating applications from the template. Others could see what this template offers.
What do you think about PowerApps and the template used? What would you change in it? Would you like to see how I make changes in the application?