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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Only send mail if item...
Power Automate
Unanswered

Only send mail if item was created within the last time the Flow was run

(0) ShareShare
ReportReport
Posted on by 50

Hi, I have a Flow created that runs on a schedule that pulls objects from Microsoft Graph and sends a mail to an admin on newly created objects.  The Flow runs every hour and on the next run I only want to send mail about object created within the hour after the Flow ran last time.  Is there a creative way to do this?

Categories:
I have the same question (0)
  • Jcook Profile Picture
    7,781 Most Valuable Professional on at
    Hi,

    You can store the date and time using the convert time action. And passing in utcNow()

    Now you will need to store this date time somewhere. Anywhere that the flow can access. Like SharePoint, Or SQL.

    At runtime you can query and get the date time value and use that as a filter on the Graph objects.

    —Josh
    If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others
  • cbernier35 Profile Picture
    50 on at

    How would you filter the Graph items?  Would you Parse the JSON and then do a select or would you filter the query during the Graph call?  Any examples you can share?

  • VictorIvanidze Profile Picture
    13,079 on at

    Hi @cbernier35,

     

    did you read this: https://docs.microsoft.com/en-us/graph/query-parameters ? 

  • cbernier35 Profile Picture
    50 on at

    Yes, many times.  You can't do dynamic calls using $filter such as utcNOW()

  • VictorIvanidze Profile Picture
    13,079 on at

    But the value of utcNow() you can add to the search parameter, correct?

    Did you do that?

  • cbernier35 Profile Picture
    50 on at

    no that doesn't work for Graph calls.  Ideally I need utcNOW() -x number of minutes  From what I can tell you can't do that in a Graph call.  Only specific date/time value is allowed.

  • VictorIvanidze Profile Picture
    13,079 on at

    Sorry I don't understand what's your problem.

    1. define a string value currentDateTime

    2. set currentDateTime=formatDateTime(utcNow()-x, 'MM/dd hh:mm')

    3. create URL for the graph request using currentDateTime

    etc

  • cbernier35 Profile Picture
    50 on at

    Sorry should have been clearer. I have no option to do in the Graph query directly without creating a variable first.  I'm using Postman to create the auth and query then importing as a custom connector in Power Automate.

    I want to do this:  https://graph.microsoft.com/v1.0/xyx/?$filter=xyzDateTime gt (utcNow()-x, 'MM/dd hh:mm')

  • VictorIvanidze Profile Picture
    13,079 on at

    Use premium action  'Invoke an HTTP request' instead of the custom connector. 

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!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 239 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 177 Super User 2026 Season 1

#3
Kalathiya Profile Picture

Kalathiya 97 Super User 2026 Season 1

Last 30 days Overall leaderboard