Skip to main content
Power Automate
    • Connectors
    • Templates
    • Take a guided tour
    • Digital process automation
    • Robotic process automation
    • Business process automation
    • Process advisor
    • AI Builder
  • Pricing
  • Partners
    • Blog
    • Documentation
    • Roadmap
    • Self-paced learning
    • Webinar
    • Business process and workflow automation topics
    • Overview
    • Issues
    • Give feedback
    • Overview
    • Forums
    • Galleries
    • Submit ideas
    • User groups
    • Register
    • ·
    • Sign in
    • ·
    • Help
    Go To
    • Microsoft Power Automate Community
    • Welcome to the Community!
    • News & Announcements
    • Get Help with Power Automate
    • General Power Automate Discussion
    • Using Connectors
    • Building Flows
    • Using Flows
    • Power Automate Desktop
    • Process Advisor
    • AI Builder
    • Power Automate Mobile App
    • Translation Quality Feedback
    • Connector Development
    • Power Platform Integration - Better Together!
    • Power Platform Integrations
    • Power Platform and Dynamics 365 Integrations
    • Galleries
    • Community Connections & How-To Videos
    • Webinars and Video Gallery
    • Power Automate Cookbook
    • Events
    • 2021 MSBizAppsSummit Gallery
    • 2020 MSBizAppsSummit Gallery
    • 2019 MSBizAppsSummit Gallery
    • Community Engagement
    • Community AMA
    • Community Blog
    • Power Automate Community Blog
    • Community Support
    • Community Accounts & Registration
    • Using the Community
    • Community Feedback
    cancel
    Turn on suggestions
    Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
    Showing results for 
    Search instead for 
    Did you mean: 
    • Microsoft Power Automate Community
    • Galleries
    • Power Automate Cookbook
    • Re: Out of Office Auto Reply - off hours, weekends...

    Re: Out of Office Auto Reply - off hours, weekends, and exclusion list

    11-18-2022 13:17 PM

    ggora
    Regular Visitor
    752 Views
    LinkedIn LinkedIn Facebook Facebook Twitter Twitter
    swelch
    swelch
    Frequent Visitor
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    Out of Office Auto Reply - off hours, weekends, and exclusion list

    ‎04-02-2021 12:35 PM

    This flow will check against off hours, weekends, and a sender exclusion list to decide if it needs to send an after hours email or not.

     

    After Hours Flow.png

     


    This flow Section breakdown:

     

    *This needs to be created from an automated flow*

     

    1. When a new email arrives in a shared mailbox (V2) Operation - Trigger for the flow. 
      1. Original Mailbox Address will be the shared email you are wanting to watch
      2. Folder will most likely be the inbox. Whichever folder within the email you want to watch
    2. utc to est - Convert Time Zone Operation - emails (at least on my tenant) seem to come in as UTC instead of our time zone. You can check for yourself by running a test and check the output from the "When a new email arrives" section. If you search for Received you will probably see the time is different than your local time
      1. Base time is set to pull the time the email was received
      2. Format String should be sent to the sortable date/time pattern
      3. Source Time Zone: UTC
      4. Destination: Whatever your time zone is
    3. val weekday - Compose Operation - further along, the check will need to know what day of the week it was when the email was received. The input provided calculates that and provides a number 0-6 representing the days
      1. Sunday - 0
      2. Saturday - 6
    4. Date Removal - Compose Operation - further along, the check will not like the format the time and date are currently in, so the date part needs to be dropped. The input formats it so that only the time is listed
      1. Make sure to capitalize the HH at the end section. HH will be 24-hour time, hh will not.
    5. Weekend and Time Check - Or Condition Operation - This is the section doing all the time/date comparing. It checks to see if any of the conditions are met. If NONE of the conditions are met (email arrived between 8am-4:30pm M-F), it will end the flow. If ANY of the conditions are met, it will continue to the next step
      1. Make sure it is set to an Or function. That way only one of the conditions need to be satisfied
      2. First two are checking the day of the week. They check to see if the day of the week is equal to 0 (Sunday) or 6 (Saturday).
      3. The last two check on the time the email was received. The first checking if the time is after 4:30pm (16:30 in 24-hour time) and the second checking if the time is before 8:00am (8:00 in 24-hour time)
    6. Weekend and Time Check Condition Results
      1. If no - Terminate Operation - You'll want to set the flow to terminate and set the status to cancelled to signify it went through the flow and found it did not need to sends the email successfully
      2. If yes - Flow continues on to go through exclusion check
    7. FromValue - Compose Operation - Makes an easily accessible value of the From for the initial email
    8. FromCaps - Compose Operation - Converts the from email address to all caps. The From Check below is case sensitive, so it is best to just make it compare everything in all caps to avoid things slipping through.
    9. From Check - Condition Operation - All of the email addresses and key words you want to be excluded will be listed here. For the example, I have VOICEMAIL@FAKECOMPANY.COM listed so that if that if the watched email receives an email from that address, an auto reply will not be sent out. I also have PRINTER on there to catch any email address with the word printer in it. That prevented me from needing to add every printer email address to the exception list individually.
      1. Using key words instead of individual emails can make the process much easier. 
      2. Make sure everything listed is in ALL CAPS or else the check will not work properly.
      3. Also make sure to set it to an Or condition.
      4. You can add a total of 10 individual checks but if you group some together, you can go past the 10 limit, then ungroup them.
    10. From Check Condition Results:
      1. If Yes - The flow is terminated in the same way as the other termination. This would indicate that the flow detected that the from address included one of the keywords/emails listed in the From Check
      2. If No - The flow continues to send out the email. Meaning the flow did not see any of the emails/keywords in the from address
    11. Send an email from a shared mailbox (V2) Operation - This is where you will compose the email to be sent out.
      1. Original Mailbox Address - probably want to make it the same email you are watching, but you do you!
      2. To - Set this to From so that the email is sent to the initial sender
      3. Subject and Body - You may want to test a couple rounds with this to get the formatting right. It can be a bit finnicky. 
      4. Advanced Options - Up to you, but I recommend changing the Importance setting from low to Normal.
    AutomaticAfterHoursReply.zip
    128 KB
    Labels:
    • Labels:
    • Automated Flows
    Message 1 of 2
    2,251 Views
    2 Kudos
    Reply
    • All forum topics
    • Previous Topic
    • Next Topic
    ggora
    ggora
    Regular Visitor
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎11-18-2022 01:17 PM

    Hello I am newer to PA and I know this is a little old.  But working for my needs.   How would I add a check for specific dates like Holidays into the Weekend and Time check. 

    Message 2 of 2
    752 Views
    0 Kudos
    Reply

    Power Platform

    • Overview
    • Power BI
    • Power Apps
    • Power Pages
    • Power Automate
    • Power Virtual Agents

    • Sign up free
    • Sign in

    Browse

    • Templates
    • Connectors
    • Partners

    Downloads

    • Mobile
    • Gateway

    Learn

    • Documentation
    • Learn
    • Support
    • Community
    • Give feedback
    • Blog
    • Pricing

    • © 2023 Microsoft
    • Contact us
    • Trademarks
    • Privacy & cookies
    • Manage cookies
    • Terms of use
    • Terms & conditions
    California Consumer Privacy Act (CCPA) Opt-Out Icon Your California Privacy Choices