cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

create a time of day trigger

I am looking to trigger an auto-reply for emails after-hours.  Each day between 5PM and 9AM but I keep getting a time error.  Does anyone know the correct format for this?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Anonymous
Not applicable

Re: create a time of day trigger

Hello,

 

I've just tried this out and got it to work - in your Start and End time, you have to provide the date as well as the time. In your case, I would assume you want this to be the current date. You can use dynamic content and formulas for that - the formulas I'm using are utcNow() which gives you the current date, formatDateTime() to format the date and time and concat() to concatenate the current date with the timestamp you want:

 

I've set Start Time to:

concat(formatDateTime(utcNow(), 'yyyy-MM-dd'), 'T','17:00:00-00:00')

I've set End time to (this adds an extra day to the current date for tomorrow using addDays)

concat(formatDateTime(addDays(utcNow(), 1), 'yyyy-MM-dd'), 'T','09:00:00-00:00')

If you click on Start Time/End Time and select dynamic content and then "Expression" and copy the above formula in the bar, that should work for you.

 

Your action box will look like this then

image.png

 

If expressions are new to you here's a blog about them:

https://flow.microsoft.com/en-us/blog/use-expressions-in-actions/

View solution in original post

4 REPLIES 4
Highlighted
Memorable Member
Memorable Member

Re: create a time of day trigger

Hey @Micah 

 

 

Can you show us your current set up of your trigger?

 

Kind regards

 

 

Tom



If this reply has answered your question or solved your issue, please mark this question as answered.

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

Highlighted
Frequent Visitor

Re: create a time of day trigger

Hi @Tom_Slosse 

There isn't much to it as this is my first time creating one.

sample.JPG

Highlighted
Anonymous
Not applicable

Re: create a time of day trigger

Hello,

 

I've just tried this out and got it to work - in your Start and End time, you have to provide the date as well as the time. In your case, I would assume you want this to be the current date. You can use dynamic content and formulas for that - the formulas I'm using are utcNow() which gives you the current date, formatDateTime() to format the date and time and concat() to concatenate the current date with the timestamp you want:

 

I've set Start Time to:

concat(formatDateTime(utcNow(), 'yyyy-MM-dd'), 'T','17:00:00-00:00')

I've set End time to (this adds an extra day to the current date for tomorrow using addDays)

concat(formatDateTime(addDays(utcNow(), 1), 'yyyy-MM-dd'), 'T','09:00:00-00:00')

If you click on Start Time/End Time and select dynamic content and then "Expression" and copy the above formula in the bar, that should work for you.

 

Your action box will look like this then

image.png

 

If expressions are new to you here's a blog about them:

https://flow.microsoft.com/en-us/blog/use-expressions-in-actions/

View solution in original post

Highlighted
Frequent Visitor

Re: create a time of day trigger

Hello Manuela,

 

The flow test was successful, thanks.  One thing I noticed though was the end time in your example shows T 09:00:00-00:00.  Should it be the otherway around T 00:00-09:00:00 for midnight to 9AM?

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Users online (3,508)