Introduction
Friday afternoon, I am sitting at my laptop and finishing some stuff. We all know this. “It’s Friday I won’t start any new tasks, just do some cleanup”. My boss calls, and says there is a company event and if we can provide some enhanced form which would enable users to create groups, add themselves to the them and then, each time they do some sport, submit kcals. Although he multiple times stressed, he doesn’t want me to do anything just think about it during the weekend, for me it was perfect Power Apps use case and I challenged myself to prepare working prototype like request would be “we need an app by Monday morning”.
Weekend stuff
So during the weekend I spent couple of hours by making app. While it had to fit into E3 subscriptions I selected Sharepoint list as datasource. This decision will give me some hard time later. Anyway, one List was for users and their groups and second for transactions – submitted kcals. Maybe hardest task was to create functionality for Office 365 users lookup. As I never did this I googled for some time and found usable template inside Power Apps. Since It was for mobile app I had to adjust graphics, but main functionality was reused. Then I added some validations – that users is not in any group and group name is not used already, but this was not hard to do. Lastly I prepared main screen where users can submit new record (kcal number) and information about him (name, his team, and sum of his kcals).
I presented this prototype to my boss and later to the lady who managed the event. She was brave enough to agree that we will continue with development and use the app. Since process of teams and users onboarding was already in progress (good old e-mails) we agreed that we will not open functionality for creating groups to end users.
More features & design
So the main structure was done. I added gallery with all teams with possibility to click on it and see team members and their Kč (CZK). This was interesting lesson for gallery in gallery scenario. I also added another screen with two charts. Kč by users and Kč by teams. Although it was first time I use this functionality it was very intuitive and one youtube video (thanks Shane) was enough to prepare nice charts. Last, but not least I added counter on the main screen which shows sum of all contributions and played little bit with overall design, colors, images, aligning textbox, icons, etc. Note that although users submits kcals, app shows Kč (CZK). Reason was that for every 10 kcal TV NOVA gave 1Kč to Nadace Nova fundation.
Stuff around
PowerApps was not only Microsoft technology utilized for the event. I also prepared Teams group for all participants and based on the List with users/teams I created flow which added all users into Teams group. Another Flow initialized users (everyone got 10 kcal just for joining the event). Lastly I used Flow to perform load test as you can read about in the next paragraph.
Lesson learned #1
From very beginning I was curious how the app and aggregations to sum kcals from transaction List will perform if more records (hundreds/thousands) would be created. While it looked only few people will join the event I did not take care much about it. Everything changed when I realized that there are more than 200 users. I decided to do a load test and by Flow created more then 2k records in transaction list. App was slower, but bigger issue was fact that I hit delegation limit (2000 records) for Sharepoint datasource. (yes, this limit was somewhere deep in my head from the very beginning). Because “go live” was quite near I just added another column to user List which will hold sum of kcals and changed logic of app in a way that when user submit kcals it will be added to the user List. So there were no performance consuming aggregations and no problem with delegation. Transactions was still created but not used in the app. As result, app was quicker and always loaded only as much rows as there were users.
Lesson learned #2
So we successfully kicked off the event, and users started to submit kcals. No issues until two days when I received call that some users has problem with counting kcals. To be specific, each time they submit number, it overwrites their sum of kcals not add as it should. Short panic and thinking of some cache problems, but soon I realized that app did not recognized some users. Why? Because when you do comparation of strings in PowerApps it is CASE SENSTIVE. So some users was logged with first letter uppercase but in List with all lowercases. Fix of app was easy – use lower function on both sides of comparation. Fix of data was more time demanding but thanks to transactions which were saved each time, I was able to rebuild sum of kcals for all affected users (not more than 10).
Summary
And that’s it, rest of month running event I did just some minor updates to layouts and in the end disabled kcals submit feature. App was stable, no issues were reported. Some users used it also from their mobiles, although it was not designed for it, it did a job done. App with leaderboard and graphs ignited competition spirit in us and it was more fun that If attendees would only send e-mails with kcals and wait a week to see who’s winning. Last but not least it made life much easier to my colleagues who did not have to create excel table and collect information from e-mails. For me it was first time I created app used by that amount of users. I also went through all stages of development from design, load tests, tests with few users and through important part of support during usage. And best part of it was that we did something to our health and thanks to TV NOVA helped to raise more than 200k CZK for Nadace Nova fundation.