cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
allrounder799
Regular Visitor

Trigger Conditions - Certain Time of the Day

 Hello Everyone,

 

I receive a bunch emails with various performance reports attached, every 2-3 hours. I want to save these reports to their respective folders in OneDrive. The last of these emails come between 20:00 & 21:00 containing the final performance for the day. I want to save the attachments of these emails which come between 20:00 & 21:00 hours daily.

I created a Flow with the trigger as "When Email Arrives" for Office365 but I don't know what expression to put in the "Trigger Conditions" field so that the trigger is only active between 20:00 & 21:00 hours.

 

Your help would be appreciated. Thank You 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

Hi @allrounder799 ,

 

We couldn't use the trigger condition currently however we could add the condition under the trigger to check the email received time, if the received time is besides 20:00 & 21:00 hours, save the attachments in the OneDrive, if not, do nothing.

1.png

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

13 REPLIES 13
ChristianAbata
Most Valuable Professional
Most Valuable Professional

hi @allrounder799  unfortunally you can't use time conditions in outlook trigger.

 

Could be a great idea.

 

https://powerusers.microsoft.com/t5/Power-Automate-Ideas/idb-p/MPAIdeas

 

 



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me:
Youtube: Christian Abata
Facebook: Power Automate LA
Power Automate examples: Power Automate examples
v-alzhan-msft
Community Support
Community Support

Hi @allrounder799 ,

 

We couldn't use the trigger condition currently however we could add the condition under the trigger to check the email received time, if the received time is besides 20:00 & 21:00 hours, save the attachments in the OneDrive, if not, do nothing.

1.png

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Thanks for the Reply.

 

I thought that simple time-based trigger conditions would be available. Anyways will put that into the features request link you sent. 

 

Well this will solve my problem. Thanks for the solution. The only thing that concerns me is hitting "Trigger Limits" on my Free plan. I receive 4 types of reports, 3 of them 6 times in a day and one 13 times. I did the calculations and the Flow would be triggered approx 930 times in month and theoretically run 120 times/month. I checked out the limitations  page but couldn't understand them clearly. Can you please tell me whether this will be the problem?

Hello, better late than never I say. The trigger condition you're looking for is:
@if(and(greater(FormatDateTime(utcnow(),'HH:mm'),'20:00'),less(FormatDateTime(utcnow(),'HH:mm'),'21:00')),true, false)
You can use these time expressions in triggers (maybe you couldn't 2 years ago), i tested it myself.
Watch out, you might have to adjust it to your GMT. For example I live in Central Europe (GMT+1), so if I want it to trigger between 20:00 and 21:00 local, I'd set it up for 19:00-20:00.
Also, since you're comparing strings as greater/lesser, always use 09:00 instead of 9:00, or it'll break.
See ya

Poojavemula
Regular Visitor

Hello All,

I want to put trigger condition to shared mailbox...i have used "when a new email arrives in shared mailbox" but the requirement was to send automatic mail after business hours which I need to put from 5:01 PM Est to 6:59 AM est ..iam using received time as base time and converting to EST and using converted time in condition in flow and it's working..

  • but now iam worried that it will trigger for each mail receives in office hours also..can someone help me with trigger condition to only trigger in those EST timings please @v-alzhan-msft @DavidHorsky @ChristianAbata 
Poojavemula
Regular Visitor

Tried below formula but expression itself is invalid it's saying.. please help on this.

@if(and(greater(FormatDateTime(utcnow(),'HH:mm'),'21:00'),less(FormatDateTime(utcnow(),'HH:mm'),'10:59')),true, false)

 

@DavidHorsky 

Hi, @Poojavemula
tell me if I understand it correctly:
You want to send people writing you email outside of bussiness hours (7AM-5PM) an automatic reply to say something like "I'll get to you in the morning, have a nice evening".
Well if you don't set up trigger condition, the When a new email arrives will indeed trigger with every email.
It should be:
@or(greater(FormatDateTime(utcnow(),'HH:mm'),'17:00'),less(FormatDateTime(utcnow(),'HH:mm'),'07:00'))
In layman's terms, if the time is more than 17:00, or less than 7:00 trigger the flow.
Watch out, there is difference between 'hh:mm' and 'HH:mm'. First one is 12 hour format, avoid it at all costs. 
Of course, you should adjust for the time zone. (I do it manually, but there is a function for that).
i.e. If you live in GMT+5, its gonna be:
@or(greater(FormatDateTime(utcnow(),'HH:mm'),'12:00'),less(FormatDateTime(utcnow(),'HH:mm'),'02:00'))
(just ask yourself, if GMT+5 is 17:00, what is GMT+0, always solves it for me)
Hope it helps

Poojavemula
Regular Visitor

Thank you so much for your response David..yes that's working..But the problem is about the weekends..on weekends it should send automatic mail whole day irrespective of timings.how to manage that part . please help me on this..

Thank you so much for your response David..yes that's working..But the problem is about the weekends..on weekends it should send automatic mail whole day irrespective of timings.how to manage that part . please help me on this.

@DavidHorsky 

Thank you so much for your response David..yes that's working..But the problem is about the weekends..on weekends it should send automatic mail whole day irrespective of timings.how to manage that part . please help me on this.

@DavidHorsky 

Well then you should use the dayOfWeek(utcnow()) function.
This function should return 1 on monday, 2 on tuesday, etc. For better understanding, I'll put it on two lines.
@Anonymous(
or(greater(FormatDateTime(utcnow(),'HH:mm'),'12:00'),less(FormatDateTime(utcnow(),'HH:mm'),'02:00')),
or(eq(dayOfWeek(utcnow()),6), eq(dayOfWeek(utcnow()),7)))
Hope you get the idea 😉

Poojavemula
Regular Visitor

Hello @DavidHorsky 

 

Thank you so much..with small modification it worked.can i have your linkedin profile here if possible.Thank you.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (939)