Stage 9 of 17
In this stage you will build the Power Automate approval flow. The flow is triggered when a new leave request is submitted, sends an approval email to the manager, updates the list record with the decision, and notifies the employee. Every action is documented with its configuration and the reasoning behind it.
Why Are We Doing This?
Navigate to make.powerautomate.com. Sign in with your Microsoft 365 account.
Select "+ Create" from the left navigation. Choose "Automated cloud flow".
Flow name: "DToDLab002-LeaveApproval". Search for the trigger: "When an item is created". Select the SharePoint trigger "When an item is created". Select Create.
Configure the trigger: Site Address: select your Leave Request System SharePoint site. List Name: select "Leave Requests". Select Save.
Common Mistake
Trigger: When an item is created
SharePoint connector
Site Address
https://[tenant].sharepoint.com/sites/LeaveRequestSystem
List Name
Leave Requests
Important: This trigger fires for every new item, including Drafts. The next action (the status condition) prevents the flow from proceeding for non-Submitted records.
Condition: Check if Status = Submitted
Select "+ New step" → "Condition". Configure the condition:
To add the Status field: in the left box, select "Add dynamic content". Find "Status" in the list of fields from the trigger. Select it. In the middle box, select "is equal to". In the right box, type "Submitted" (exactly as it appears in the choice column).
If Yes
Continue to the approval action (Actions 3–8).
If No
Add a Terminate action with Status = Succeeded. This ends the flow gracefully for Draft records.
Start and wait for an approval
Inside the Yes branch of the condition, select "+ Add an action". Search for "Approvals". Select "Start and wait for an approval". Configure as follows:
Approval type
Approve/Reject — First to respond
Title
"Leave Request — " + EmployeeName + " — " + StartDate + " to " + EndDate (use dynamic content)
Assigned to
ManagerEmail (dynamic content from trigger)
Details
Build a message including: Employee Name, Leave Type, Start Date, End Date, Working Days, Employee Comments. Use dynamic content for each field.
Item link
Optional: the URL of the SharePoint list item. Allows the manager to open the full record.
Flow pause: The flow pauses at this action until the manager responds. The flow run will show as "Running" in the run history until a response is received. If the manager never responds, the flow will eventually time out (after 30 days for standard flows).
concat(
'Leave Request — ',
triggerOutputs()?['body/EmployeeName'],
' — ',
formatDateTime(triggerOutputs()?['body/StartDate'], 'dd/MM/yyyy'),
' to ',
formatDateTime(triggerOutputs()?['body/EndDate'], 'dd/MM/yyyy')
)What this does: concat() joins multiple strings together. triggerOutputs()?['body/EmployeeName'] retrieves the EmployeeName field from the trigger output. The ?[] syntax is safe navigation — it returns null rather than an error if the field is missing. formatDateTime() formats the date in a readable format. You can build this using the dynamic content picker rather than typing the expression manually.
Condition: Check approval outcome
After the approval action, add another Condition. Configure:
The Outcome field comes from the approval action's dynamic content. It will be either "Approve" or "Reject" depending on which button the manager selected in the approval email.
If Yes (Approved)
Update list record with Status = Approved. Send approval notification email.
If No (Rejected)
Update list record with Status = Rejected. Send rejection notification email.
Update item — Set Status to Approved
Inside the Yes branch, add "SharePoint — Update item". Configure:
Site Address
Your Leave Request System site
List Name
Leave Requests
ID
ID (dynamic content from trigger — the ID of the record that triggered the flow)
Status
"Approved"
Approver
Responders Approver name (dynamic content from the approval action)
Decision Date
utcNow() expression — the current date and time
Approver Comments
Responders Comments (dynamic content from the approval action)
Send email — Approval notification to employee
Add "Office 365 Outlook — Send an email (V2)". Configure:
To
EmployeeEmail (dynamic content from trigger)
Subject
"Your leave request has been approved — " + StartDate + " to " + EndDate
Body
Include: employee name, leave type, dates, working days, approver name, approver comments, and a note to contact HR if they have questions.
Update item — Set Status to Rejected
Inside the No branch, add "SharePoint — Update item". Configure identically to Action 5, except set Status to "Rejected". The Approver, Decision Date, and Approver Comments fields are populated the same way — from the approval action's dynamic content.
Send email — Rejection notification to employee
Add "Office 365 Outlook — Send an email (V2)". Configure:
To
EmployeeEmail (dynamic content from trigger)
Subject
"Your leave request has been rejected — " + StartDate + " to " + EndDate
Body
Include: employee name, leave type, dates, approver name, and approver comments. The approver comments are especially important for rejections (DF-004) — the employee needs to know why.
Terminate — Graceful exit for non-Submitted records
In the No branch of Action 2 (the status condition), add "Control — Terminate". Set Status to "Succeeded". Do not use "Failed" — a Failed status generates alerts and makes the run history look like something went wrong, when in fact the flow correctly identified a non-Submitted record and stopped.
Save the flow. Select "Test" → "Manually" → "Test".
Open the Power Apps app. Submit a new leave request with your own email as the employee email and a test manager email (ideally an email address you can access).
Return to Power Automate. The flow should show as "Running" in the run history.
Check the manager's email inbox. An approval email should arrive with Approve and Reject buttons.
Select Approve. Add a comment: "Approved — enjoy your holiday."
Return to Power Automate. The flow should now show as "Succeeded".
Check the employee's email inbox. An approval notification should have arrived.
Open the Leave Requests list in Microsoft Lists. Find the record. Verify: Status = Approved, Approver = your name, Decision Date = today, Approver Comments = "Approved — enjoy your holiday."
Open the Power Apps app. Navigate to My Requests. Verify the request shows Status = Approved.
SUP-003 requires the IT Manager to be added as a co-owner of the flow. This prevents the flow from failing if the original creator's account is disabled or the person leaves the organisation.
Open the flow in Power Automate.
Select the three-dot menu (or look for "Share" or "Manage" in the flow details). Find the option to add co-owners or share the flow.
Add the IT Manager's email address (Marcus Webb / marcus.webb@contoso.co.uk in the fictional scenario, or your IT Manager's real email in a real deployment).
The co-owner can now view, edit, and manage the flow.
Manager email is invalid
What happens
The approval action will fail with an error. The flow run will show as Failed.
How to handle it: Check the run history. Expand the failed action to see the error message. Correct the manager email in the list record and re-trigger the flow manually (or ask the employee to submit a new request).
Manager never responds
What happens
The flow will wait indefinitely (up to 30 days for standard flows). After 30 days, the flow times out and the request remains in Submitted status.
How to handle it: The reminder flow (FR-016) helps by sending a reminder after two working days. For a timed-out request, the IT Manager can manually update the status in the list.
Flow fails after the approval but before the list update
What happens
The manager has approved but the list record still shows Submitted. The employee has not been notified.
How to handle it: Check the run history. Find the failed action. Correct the issue and re-run the flow from the failed action (Power Automate supports re-running from a specific action in some cases). Alternatively, manually update the list record.
Employee cancels the request while the flow is waiting for approval
What happens
The flow is still waiting for the manager's response. When the manager responds, the flow will update the status to Approved or Rejected, overwriting the Cancelled status.
How to handle it: This is a known limitation of the v1 design. A more robust solution would check the current status before updating it. Add a condition before the Update item actions: if Status = Cancelled, terminate instead of updating.
Need more help with the concepts?
Visit DosToDigital for guides, templates, and deeper explanations.