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 / Triggering action when...
Power Automate
Answered

Triggering action when time is between certain hours

(0) ShareShare
ReportReport
Posted on by 10

Hello All,

 

I have reviewed multiple confirmed solutions in this forum, but either I can't replicate the solutions or they don't work for me.

 

My scenario is (I think) pretty simple: if a meeting invite is received between certain hours --> do something.

 

I have created the following flow.

1. I trigger the flow when my account receives a new invite

2. Convert Start Time: I convert the "Start date" of the invite into an integer using the following expression

 

Int(concat(slice(triggerOutputs()?['body/start'], sub(indexOf(triggerOutputs()?['body/start'], ':'), 2), indexOf(triggerOutputs()?['body/start'], ':')), split(triggerOutputs()?['body/start'], ':')[1]))

 

3. Convert End Time: I convert the "End date" of the invite into an integer using the following expression

 

Int(concat(slice(triggerOutputs()?['body/end'], sub(indexOf(triggerOutputs()?['body/end'], ':'), 2), indexOf(triggerOutputs()?['body/end'], ':')), split(triggerOutputs()?['body/end'], ':')[1]))

 

4. I check if the Start Date is greater than 1130 and if the End Date is less than 1245

 

alessandroetern_0-1671397941243.png

 

I tested the flow multiple times, but the condition returns always "False" even if the test invite is in between the defined hours. I can clearly see from the logs that my "Compose" actions work as expected, but somehow the condition doesn't. I start to think that it is because I am not comparing real numbers.

 

alessandroetern_1-1671398318025.png

Any idea?

 

Thank you.

Categories:
I have the same question (0)
  • Verified answer
    v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @alessandroetern 

     

    Please make sure to call the correct dynamic content in the condition:

    vliweimsft_0-1671413988865.png

    Or you can put the expression in Compose directly into the condition instead of referencing Compose in the condition.

    vliweimsft_1-1671414772199.png

     

     

    Best Regards,

    Levi

     

  • alessandroetern Profile Picture
    10 on at

    @v-liwei-msft 

     

    Thank you for your feedback.

     

    I checked the condition and I was calling the dynamic content properly: first the "Start Date' then "End Date".

     

    I tried your second suggestion and, oddly, it started to work.

     

    I did some tests and the flow works, but it does not produce the result I was expecting.

     

    For example if the meeting invite starts before 1230 or ends after1345 the flow doesn't do anything.

     

    I think because (as far as I can see from my tests) it takes action only if the meeting invite is exactly between 1230 and 1345.

  • v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @alessandroetern 

     

    According to your settings in the condition, the condition is only met if the start time is greater than 1130 and the end date is less than 1245.

     

    Best Regards,

    Levi

  • alessandroetern Profile Picture
    10 on at

    Yeah...sorry I forgot to clarify this point.

     

    I am in CET timezone and the flow is in UTC timezone, so:

    - 1130 = 1230

    - 1245 = 1345

     

    Apologies for the confusion

  • v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @alessandroetern 

     

    I suggest you convert the start date and end date to the time zone you need first using the convert timezone function before converting it to a number.

     

    Best Regards,

    Levi

  • alessandroetern Profile Picture
    10 on at

    Hi,

     

    I didn't convert the time yet, but I figured out the issue I described in my previous post.

     

    ---

    I did some tests and the flow works, but it does not produce the result I was expecting.

     

    For example if the meeting invite starts before 1230 or ends after1345 the flow doesn't do anything.

     

    I think because (as far as I can see from my tests) it takes action only if the meeting invite is exactly between 1230 and 1345.

    ---

     

    I have "duplicated" the conditions. I check if the start time is between 1130 and 1230 OR if the end time is between 1130 and 1230.

     

    Regards.

     

     

  • v-liwei-msft Profile Picture
    Microsoft Employee on at

    Hi @alessandroetern 

     

    I'm glad to see that you found the problem.

    Could you please tell me is the flow running successfully?

     

    Best Regards,

    Levi

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 813

#3
Haque Profile Picture

Haque 526

Last 30 days Overall leaderboard