
Announcements
Hi all. Apologies for starting a new thread for something which has already been discussed here -> https://powerusers.microsoft.com/t5/Building-Power-Apps/Creating-a-List-of-All-Employees-Leaves-and-Calculating-their/m-p/682414#M218172, but I'm really struggling and not able to get this right 😞
I downloaded and followed RandyHayes great app and instructions, however I am still struggling and I'm really hoping someone could assist me, please. I've been battling with this for quite a while now.
Perhaps I just need to edit the formulas of Randy to fit in with my app, but I'm not sure what to do. I'm a new user and lost 😞
Basically, I have 1 SharePoint List, called CWLeaveRequests with the following columns:
- Name and Surname
- Start Date
- End Date
- Type of Leave
- Status
- Supervisor Notes
- Staff Notes
- Number of Days
- Attachments
- Supervisor
- Start Year (I added this as per Randy Hayes suggestion)
On my App, I have 4 screens namely:
- HomeScreen
- RequestFormScreen
- SuccessScreen
- RequestHistory
Currently, when I create a new leave request, it adds the data to my SharePoint list, and then a flow runs which emails a supervisor to approve. If approved/rejected it updates the list. So far, that all works 100%.
My different leave types are as follows:
- Annual Leave
- Sick Leave (provide supporting evidence when applicable)
- Study Leave (provide supporting evidence)
- Family Responsibility Leave (provide supporting evidence)
- Unpaid Leave
- Maternity Leave
- Paternity Leave (provide supporting evidence)
Now, I want to display the different leave types with their balances on the RequestFormScreen and I'd really really appreciate some help with the coding and where to add it, etc.
If supervisor approves, it deducts the number of days that was requested and if rejected, the balance stays the same for that particular leave type.
If leave requested exceeds the leave balance (for the particular leave type) staff members gets a "sorry, leave exceeded " message or pop up of sorts.
I would also like the annual leave that is not taken by a staff member to be able to carry over to their leave balance for the next year.
At our company, we get 1.25 days per month (15 total days per year) for annual leave so this can probably be hard coded somewhere, not sure where though
Sick Leave is 30 days over 3 years
Family Responsibility Leave is 3 days per year
Please guys. I'll be super grateful if anyone could help.
I can post screenshot of my app and/or flow as well as my SharePoint list if need be.