Out of Office Auto-Setup
When an approved out-of-office request is detected in a SharePoint list, automatically sets the employee's Outlook automatic replies, updates their Teams status, and notifies their team.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
Out of Office Auto-Setup watches a SharePoint list of OOO (out-of-office) requests and, the moment a request flips to Approved, performs the full end-to-end setup the employee would otherwise have to do by hand. It reads the requester's start date, end date, and away message from the list row, calls Microsoft Graph to set the user's Outlook automatic replies for the exact window, updates their Teams presence message via Graph, posts a heads-up to their team's channel so colleagues know who is covering, emails the requester a confirmation summary, and writes the run result back to the list item for an audit trail. The flow is built as a single automation so HR or the employee only have to fill in the SharePoint request — every downstream setup step is handled for them.
Use Case
Most organizations rely on each employee to remember to turn on their Outlook automatic replies, update their Teams status, and tell their team they will be away. Steps get forgotten, replies fire on the wrong dates, and there is no single record that any of it actually happened. This flow turns an Approved OOO request in a SharePoint list into a fully provisioned absence: Outlook autoreply window set, Teams presence message updated, team channel notified, confirmation back to the requester, and the request row stamped with the outcome. It is a good fit for IT admins who want a centralized, auditable OOO process instead of trusting individual users to set everything correctly.
The flow is ideal for teams that:
- IT admins who want a centralized, auditable out-of-office setup process across the tenant.
- HR teams that already track time-off requests in a SharePoint list and want the Outlook / Teams setup to follow automatically.
- Organizations where missed or mis-dated Outlook autoreplies have caused customer-facing issues.
- Teams that want an automatic channel heads-up when a colleague's absence is approved, without anyone having to remember to post it.
Flow Architecture
When an OOO request changes in SharePoint
When an item is created or modified (SharePoint)Fires whenever a row in the OOO Requests SharePoint list is created or updated. The trigger output carries the requester (person field), their work email, the absence start and end dates, the away message, the backup contact, and the current Approval Status.
If the request is Approved
If conditionGates the rest of the flow on the request's Approval Status column so only fully approved requests trigger the Outlook, Teams, and notification setup. Anything else (Pending, Rejected, Draft) ends the run quietly.
- Initialize variables — Reads the requester's email, start date, end date, away message, and backup contact from the trigger output into runtime variables for reuse.
- Set Outlook automatic replies (HTTP to Graph) — Calls Microsoft Graph PATCH /users/{requester}/mailboxSettings with an automaticRepliesSetting payload that sets status=scheduled, the start/end date range from the request, and the away message as both the internal and external reply body.
- Update Teams presence message (HTTP to Graph) — Calls Microsoft Graph PUT /users/{requester}/presence/setStatusMessage with the away message and the same expiration date so the requester's Teams chip shows the OOO context until they return.
- Post team-channel heads-up (Teams) — Posts an adaptive card in the configured Teams channel summarising who is out, the dates, the away message, and the backup contact so the rest of the team is informed without anyone having to remember to do it.
- Send confirmation email to requester — Emails the requester a one-page confirmation listing exactly what was set up (autoreply window, Teams status, channel heads-up) so they can spot-check the result.
- Update SharePoint list item status — Writes back to the OOO Requests list row: sets the OOO Setup Status column to 'Complete' and stamps the 'Setup Completed On' date column for the audit trail.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_OOOSharePointSiteUrl | String | https://your-tenant.sharepoint.com/sites/<configure> | SharePoint site that hosts the OOO Requests list the trigger watches and writes back to. |
| flowlibs_OOOSharePointListName | String | OOO Requests | Display name of the SharePoint list that stores each absence request and its approval status. |
| flowlibs_TeamsHeadsUpTeamId | String | <configure> | Group id of the Microsoft Team that receives the absence heads-up adaptive card. Find this under Manage team > Get link to team. |
| flowlibs_TeamsHeadsUpChannelId | String | <configure> | Channel id within the team above where the heads-up adaptive card is posted (for example, the 'General' channel). |
| flowlibs_GraphApiBaseUrl | String | https://graph.microsoft.com/v1.0 | Base URL for Microsoft Graph calls. Override only when targeting a sovereign cloud (e.g. graph.microsoft.us). |
| flowlibs_AdminAlertEmail | String | alerts@yourcompany.com | Mailbox that receives an alert if the Graph autoreply or presence call fails so an admin can complete the setup manually. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| SharePoint | shared_sharepointonline | OnUpdatedItems (trigger (When an item is created or modified)) PatchItem (Writes back the OOO setup status and completion date) |
| Office 365 Outlook | shared_office365 | SendEmailV2 (Confirmation email to the requester and admin failure alerts) |
| Microsoft Teams | shared_teams | PostCardToChannelV3 (Posts the absence heads-up adaptive card in the team channel) |
| HTTP with Microsoft Entra ID (Azure AD) | shared_httpwithazureadtoken | InvokeHTTP (Sets Outlook automatic replies and Teams presence status via Microsoft Graph) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Add approval before the autoreply is set
- Insert a 'Start and wait for an approval' action ahead of the Graph PATCH so a manager has to explicitly approve the OOO request inside the flow run instead of relying on the SharePoint column being flipped manually.
- Localize the away message
- Read the requester's preferred language (from Azure AD or a SharePoint column) and pick the matching template from a small Strings list or environment variable, so French / German / Spanish users get their autoreply in their own language.
- Schedule the team heads-up for the morning of
- Replace the immediate channel post with a Delay until action keyed off the start date so the team heads-up lands the morning the absence actually begins, not the day the request was approved.
- Auto-clear at end of absence
- Add a second flow on a Recurrence trigger (daily at 6am) that scans for rows where End Date < today and OOO Setup Status = Complete, then calls Graph to set automaticRepliesSetting.status back to 'disabled' and clears the Teams presence message. Saves users from forgetting to turn the autoreply off.
- Notify the backup contact directly
- Pull the Backup Contact column from the SharePoint row and add a dedicated email to that person with the absence window and the away message, so they know to expect inbound questions during the absence.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Outlook automatic replies request body
Body sent to PATCH /users/{requester}/mailboxSettings — schedules the autoreply for exactly the approved absence window using the start and end dates from the SharePoint row.
EXPR.02Mailbox settings URL
Builds the Graph endpoint that updates the requester's mailbox settings, using the configurable base URL and the requester's UPN.
EXPR.03Status writeback value
Used in the Update item action to set the OOO Setup Status column based on whether both Graph calls returned HTTP 200 OK.
EXPR.04Approved guard
Condition expression on the If action — runs the setup branch only when the SharePoint row's Approval Status choice column equals Approved.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.