I've built a SharePoint calendar that I'm using to track employee vacation time. The employee logs into a PowerApp, enters their information (including the amount of hours they are requesting off) and clicks a submit button. When the submit button is clicked a flow is triggered which generates a "Send an Email with options" to obtain the manager's approval.
What I'm trying to do is total the number of hours that an employee has already taken off for the current calendar year. I need an action that will reference the same list and find all items where the:
- Start Date is in the current calendar year
- Employee Name is the same as the employee requesting the time off
- Status = Approved
And return the sum of the Total Hours Used column for the approved entries for that particular employee.
The idea is that the email that is sent to the manager should tell the manager how much time the employee has been approved to take off so far this year.
I started to construct a Get SharePoint Items action, however, I'm not sure if it will work. Here is what I have:
Anyone have any thoughts?