Automate Approved Leave Totals in SharePoint Lists with Power Automate
Question details
How to automatically add approved leave days from a SharePoint Leave Requests list to a user's running total in a Holiday Allowance list.

- Product
- SharePoint / Power Automate
- Device & OS
- not provided
- Scenario
- Managing employee leave requests dynamically so that balances are updated automatically across different SharePoint lists once a request is approved.
- Observed behavior
- The flow needs to trigger when a leave request is marked as Approved, locate the specific user, and update their total leave balance without duplicating the addition if the request is later edited.
Ensure you have Site Owner or Edit permissions for both the Leave Requests and Holiday Allowance SharePoint lists, as well as access to create and manage workflows in Power Automate.
Build a Condition-Based Flow to Update Leave Allowances
Set up a Power Automate flow that triggers on item creation or modification, checks for an 'Approved' status, and updates the user's running total in the corresponding list.
By utilizing SharePoint triggers and actions in Power Automate, you can seamlessly integrate two separate lists. This prevents manual data entry and ensures holiday allowances are always up to date.
Create a new automated flow and select the 'When an item is created or modified' SharePoint trigger. Point the Site Address and List Name to your Leave Requests list.
Add a 'Condition' control step. Set it to check if the 'Status' dynamic content from the trigger is equal to 'Approved'.
In the 'If yes' branch, add the 'Get items' SharePoint action. Connect it to the Holiday Allowance list and use an OData Filter Query (e.g., UserEmail eq 'RequestedByEmail') to find the matching user.
Use a 'Compose' data operation or an expression in the next step to add the 'Days taken' value from the Leave Request to the 'Total days' retrieved from the Holiday Allowance list.
Add the 'Update item' SharePoint action. Use the Item ID from the 'Get items' step (which will automatically place it in an 'Apply to each' loop) and insert your newly calculated total into the Total Days field.

Manage HR and Leave Tracking Effectively with WPS Office
If you are managing HR data, leave trackers, and employee schedules, WPS Office offers a free, lightweight, and highly compatible alternative to Microsoft Office. With a familiar user interface and seamless migration, you can build powerful automated spreadsheets for leave tracking without the steep learning curve.
- 1. Download and Install WPS Office: Get the free WPS Office suite from the official website and install it on your device.
- 2. Open Your Existing Tracker: Seamlessly open your existing Excel (.xlsx) leave tracking spreadsheets directly in WPS Spreadsheet.
- 3. Apply Built-in Formulas: Use built-in functions like SUMIF and VLOOKUP to easily automate holiday balances based on approval statuses without complex workflows.

Frequently Asked Questions
How do I avoid an infinite loop in Power Automate when updating SharePoint lists?
Infinite loops occur when a flow updates the same list that triggers it. To prevent this, use Trigger Conditions in the flow's settings to ensure it only runs when a specific field (like 'Status') is changed to 'Approved', rather than on every single modification.
Can I notify employees when their leave balance is updated?
Yes. You can add a 'Send an email (V2)' action from the Office 365 Outlook connector at the end of your 'If yes' branch. Use dynamic content to include the user's email, approved days, and new total balance.
What happens if a user is not found in the Holiday Allowance list?
If 'Get items' returns no results, the subsequent update step will fail or skip. You can add a condition checking the length of the 'Get items' output. If it equals 0, use a 'Create item' action to initialize the user's record before updating their balance.




