Hi
I'm building a leave request application using PowerApps for Teams. Here, the users from a Office365Users work group can make their requests and a manager can review and approve or reject them.
The app is almost complete, I have a table that records all the requests, and each request has a field "TimeRequested" that records how much time is being requested (using hours in this example).
The last thing I need to do (I'm struggling with that) is to record how many hours each user has remaining: I think I would need a new table for that ("LeaveBalance"), with at least a field for the user name or email, and a "TimeRemaining" field.
The image below shows the manager page with all the pending requests: when the manager clicks on the green button, that request status is updated to "Approved", and to "Rejected" by clicking the red button (those are choice values on the request table). That change occurs only on the selected request (that's why all pending requests have those buttons).
What I would like to do is, when pressing the "Approved" button, the "TimeRequested" value of that request would subtract to the "TimeRemaining" of the "LeaveBalance" table. Also, the formula should also speficy which user is making the request so it can subtract to the correct user on "LeaveBalance".
Any idea how can I achieve this? Please tell me if I need to clarify something.
Thank you
Pedro Fernandes
