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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How does the Outlook 3...
Power Automate
Unanswered

How does the Outlook 365 search determine "received:today" and "received:yesterday?"

(0) ShareShare
ReportReport
Posted on by 15

Does the search use server time?

 

Does "recieved:today" include the past 24 hours from the time the search is run?

 

We're having inconsistent results when using "received:today" and "received:yesterday" so we're trying to figure out how it's searching.  

 

Example: We're running a "received:today" email search through Flow around 8p local time and it finds an email sent at 6p, but it's not finding emails sent at 3a and 6a.  

 

When I run a manual email search using "received:today" at 11a today it's finding emails from 2p yesterday.  I'm assuming the server time is 3 hours ahead of us, but why wouldn't the above search work?

Categories:
I have the same question (0)
  • v-yuazh-msft Profile Picture
    on at

    Hi @ kylep,

     

    Could you please share a screenshot of the configuration of your flow?

     

    Do you want to search the emails that is received at today with local time?

    All times in Microsoft Flow are in Universal Time (UTC) by default.

    Does the UTC time 3 hours ahead of your local time?

     

    If you would like to search the emails that is received at today with local time, such as if search the emails that is received from time of 00:00 to 23:59 today with local time, you could take a try to convert the time as screenshot below:

    Capture.PNG

     

     

    The expression in the condition as below:

    @and(greater(items('Apply_to_each')?['DateTimeReceived'], addHours(body('Convert_time_zone'), -3)),less(items('Apply_to_each')?['DateTimeReceived'], addHours(body('Convert_time_zone_2'), -3)))

     

    If the UTC time 8 hours ahead of your local time, you could modify the expression in the condition as below:

    @and(greater(items('Apply_to_each')?['DateTimeReceived'], addHours(body('Convert_time_zone'), -8)),less(items('Apply_to_each')?['DateTimeReceived'], addHours(body('Convert_time_zone_2'), -8)))

     

    The flow would run successfully as screenshot below:

    Capture.PNG

     

     

     

    Regards,
    Alice Zhang

  • kylep Profile Picture
    15 on at

    Is it possible to search for emails in the last 24 hours?

  • v-yuazh-msft Profile Picture
    on at

    Hi @ kylep,

     

     

    If you would like to serch for the emails in the last 24 hours from the time now, you could create the flow as below:

    Capture.PNG

     

    The expression in the condition as below:

    @greater(items('Apply_to_each')?['DateTimeReceived'], addHours(utcNow(), -24))

     

    The flow would runsuccessfully as below:

    Capture.PNG

     

    Regards,
    Alice Zhang

     

  • kylep Profile Picture
    15 on at

    How do we post images here?

     

    Our flow goes like this:

     

    Recurrence: Runs once a week at 19:00

    Get emails | Search query: (from:sender@outside.com)AND(subject:servername)AND(received:today) | Top: 1

    Condition: @empty(body('Get_emails'))

    If yes: Send email

    If no: Do nothing

     

    We want to search the last 24 hours from 19:00. Emails are sent daily so we don't want to grab emails from before the 24 hour window.

     

    Will the @greater(items('Apply_to_each')?['DateTimeReceived'], addHours(utcNow(), -24)) work?

  • v-yuazh-msft Profile Picture
    on at

    Hi @kylep,

     

    For you "Recurrence: Runs once a week at 19:00" and "We want to search the last 24 hours from 19:00",could you explain more about how frequency would your flow run?Does the flow would run every week or every day?

    If the flow would run every week,please choose on which day the flow would run and set the trigger as below:

    Capture.PNG

     

     

    If the flow would run every day,please set the trigger as below:

     

    Capture.PNG

    In addition,if you would like to check if there are email arrives from the last 24 hours from19:00,and the email is send by "sender@outside.com", the email's subject is "servername", and if the email exists,you would send the email,you could take a try to create a flow as below:

    Capture.PNG

    Capture.PNG

     

    The expression in the Conditionas below:

     

    @and(and(equals(items('Apply_to_each')?['From'], 'sender@outside.com'),equals(items('Apply_to_each')['Subject'], 'servername')),greater(items('Apply_to_each')?['DateTimeReceived'], addHours(utcNow(), -24)))

    If there are email arrives from the last 24 hours from19:00,and the email is send by "sender@outside.com", the email's subject is "servername", and if the email exists, the result of condition2 would be true,and the flow would run successfully as below:

    Capture.PNG

     

    Please take a try and let me know if your issue are solved.

     

     

     

    Regards,
    Alice Zhang

  • anhthuch4ng Profile Picture
    on at

    Hi @kylep,

     

    You should be able to upload photos to your forum posts now!

     

    Have you had a chance to apply @v-yuazh-msft's suggestions to your Flow above?
    If yes and you found that solution to be satisfactory, please go ahead and mark @v-yuazh-msft's reply as the "Accepted Solution". 🙂


    Happy Flowing,

    -AT (Flow Community Admin)

  • kylep Profile Picture
    15 on at

    What is Base time?

     

    The solution won't work, because we're getting the emails before any variables are being initialized.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard