web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / enable Out of Office f...
Power Automate
Answered

enable Out of Office for users in a spreadsheet

(3) ShareShare
ReportReport
Posted on by 62
Hi,
 
I have a spreadsheet in Sharepoint, that lists users, their working days and out of office message. I would like to set whether the out of office reply is active in outlook, if it is not a working day.
I can connect to the spreadsheet and read the info, I have todays day and a list of working days for the user but in the condition, where I determine is this a working day, I always get the same answer depending on whether I phase it contains or does not contain. I then have 2 HTTP steps that should set the out of office as active or not and apply the message listed in the spreadsheet.
Either one of these steps fail with Method not allowed.
Any help would be appreciated and bear in mind this is my first attempt at a power automate flow, so don't have any experience.
 
Thanks
Dave
Categories:
I have the same question (0)
  • Suggested answer
    Fredrik_A Profile Picture
    3,644 Super User 2026 Season 1 on at
    Hey,
     
    can you please share a picture of your flow?
     
    Id recommend switching to Office 365 Outlook - Set automatic replies (V2) instead of your http calls.
     
    If my response solved your issue, please mark it as ✅ Accepted Answer and give it a like.
  • Verified answer
    Haque Profile Picture
    3,653 on at
    Hi @Scuggins,
     
    Let's troubleshoot first on  what you did:
    1. Data format mismatch: Ensure the working days for each user are stored in a consistent format, e.g., a comma-separated string like "Mon,Tue,Wed,Thu,Fri" or an array of day names. Please make sure the day you compare against (today’s day) is in the same format, e.g., "Mon" or "Monday".
    2. Case sensitivity: The comparison might be case-sensitive. Normalize both strings to lowercase or uppercase before checking contains.
    3. Exact match vs substring: If you use contains(), be careful that "Mon" does not accidentally match "Monday" or "Mon" inside another word. Consider splitting the working days string into an array and checking if the array contains the exact day string.
    4. Expression example: If your working days are a comma-separated string, you can use an expression like this in the condition:
    contains(split(toLower(items('Apply_to_each')?['WorkingDays']), ','), toLower(formatDateTime(utcNow(), 'ddd')))

    This splits the working days into an array, converts all to lowercase, and checks if today’s abbreviated day (e.g., "mon") is in that array.

     

    Let's check why HTTP steps failing with "Method not allowed":

    • The "Method not allowed" (HTTP 405) error usually means the HTTP request is using an unsupported HTTP method (e.g., POST, GET, PATCH) for the API endpoint you are calling.
    • Double-check the HTTP method you are using in each HTTP action matches what the Microsoft Graph API or Outlook API expects for setting automatic replies.
    • For setting Out of Office replies via Microsoft Graph API, the correct method is PATCH on the /me/mailboxSettings/automaticRepliesSetting endpoint.
    • Ensure your HTTP request headers and body are correctly formatted, including authentication headers.
    • Also verify that the token you use has the necessary permissions (e.g., MailboxSettings.ReadWrite).

     

    Please let me know if you have covefed the above stuff or not.

     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
  • Scuggins Profile Picture
    62 on at
    Hi Fredrik,
     
    This is the flow
     
  • Fredrik_A Profile Picture
    3,644 Super User 2026 Season 1 on at
    Hey,
     
    could you try and switch the HTTP calls with the connector i mentioned above and see if that makes a difference?
  • Scuggins Profile Picture
    62 on at
    Fredrik,
    Can I use Office 365 Outlook - Set automatic replies (V2) to set other users out of office?
  • Scuggins Profile Picture
    62 on at
    Hi Haque,
     
    How would I enter the example expression in the condition item?
     
    Thanks
     
  • Fredrik_A Profile Picture
    3,644 Super User 2026 Season 1 on at
    You are right, you can only set it for yourself using that connector. My bad!
     
    Do you have the right permissions to set automatic replies for other users in your tenant? Otherwise that might be why your HTTP call fails.
     
  • Suggested answer
    Haque Profile Picture
    3,653 on at
    Hi @Scuggins,
     
     
     
    Where record is the value you want to compare with.
  • Scuggins Profile Picture
    62 on at
     
    Yes, I have permissions.
    Thanks
  • Verified answer
    Valantis Profile Picture
    6,735 on at
     
     
    The working days comparison is likely failing because of a format mismatch. Use this expression in your condition:
    contains(split(toLower(items('Apply_to_each')?['WorkingDays']), ','), toLower(formatDateTime(utcNow(), 'ddd')))
    This splits the working days into an array, lowercases everything, and checks if today's abbreviated day (e.g. "mon") is in the list. Make sure your WorkingDays column in the spreadsheet stores values like "Mon,Tue,Wed,Thu,Fri" (comma separated, no spaces).
     
    Issue 2 - HTTP step failing with 405 Method Not Allowed
    A 405 error means the URL or HTTP method is wrong, not a permissions issue. The most common mistake is calling PATCH on the wrong endpoint.
    The correct call to enable OOO for another user is:
     
    Method: PATCH
    URL: https://graph.microsoft.com/v1.0/users/{userEmail}/mailboxSettings
    Note: the URL must end in /mailboxSettings, not /mailboxSettings/automaticRepliesSetting. The sub-endpoint only supports GET, not PATCH, which is what causes the 405.
    Body:
    {
      "automaticRepliesSetting": {
        "status": "alwaysEnabled",
        "internalReplyMessage": "your message here",
        "externalReplyMessage": "your message here"
      }
    }
    To disable use "status": "disabled"
     
    Also worth knowing: to modify another user's mailbox settings you need MailboxSettings.ReadWrite configured as an application permission (not delegated) on your Entra ID app registration. If that is set as delegated it will return a 403 Forbidden, not a 405, but worth checking once the URL is corrected.
    Can you share a screenshot of your current HTTP action so we can confirm the URL and method you are using?
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard