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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Building a flow to che...
Power Automate
Unanswered

Building a flow to check if a file was modified in the last 30 minutes

(0) ShareShare
ReportReport
Posted on by 157

I am building a flow that sends notifies people when a particular file in a Sharepoint document library is modified, which I have working. However, it literally sends hundreds of emails, as I assume it triggers whenever the autosave kicks in.

 

The best way I can think to minimize the volume of emails is to check if the modified time was within, say... the last 30 minutes using utcNow() and comparing this to the 'Modified' column in Sharepoint? I'm just not sure how the expression would look. Would I need to use:<code>@greater</code> ? Please could I have some help?

Categories:
I have the same question (0)
  • Paulie78 Profile Picture
    8,422 Moderator on at
    Re: Building a flow to check if a file was modified in the last 30 minutes

    Why not disable that trigger completely and just run the flow on a recurrence schedule and check if the file was updated in the last 60 mins? That would seem simpler to me.

     

    Or run it every half hour and check the last 30 mins. 

  • Jay-Encodian Profile Picture
    2,920 on at
    Re: Building a flow to check if a file was modified in the last 30 minutes

    @FreddieV 

    agree with @Paulie78 ,that was my first thought.

    You could consider SharePoint alerts... you can then just setup to send a daily summary and no need for a Power Automate flow.

  • FreddieV Profile Picture
    157 on at
    Re: Building a flow to check if a file was modified in the last 30 minutes

    Thanks for the reply, this does make more sense, but I am still unsure how the expression would look, or even how the fow would now look. How would it check that the document was updated?

     

    Screenshot 2020-11-25 at 17.07.36.png

     

    I can't see how this would work.

  • Verified answer
    cdn4lf Profile Picture
    182 on at
    Re: Building a flow to check if a file was modified in the last 30 minutes

    @FreddieV  you'll need to first get all items within the library.

     

    From there, you'll need to compare the modified date to the utc date - 1 hour

     

    Screenshot 2020-11-25 124004.png

     

    From there, you should be able to send your emails

  • FreddieV Profile Picture
    157 on at
    Re: Building a flow to check if a file was modified in the last 30 minutes

    Thanks very much for your help. Which is the value in the condition....greater than or equal to?

  • Paulie78 Profile Picture
    8,422 Moderator on at
    Re: Building a flow to check if a file was modified in the last 30 minutes

    I would do something like this:

    lastModified.PNG

    The output of "Minutes Since Last Modified" can be used in your subsequent conditions. The expression I used was:

    div
    (
     div
     (
     mul
    	(
    	 sub
    	 (
    		 ticks(utcnow()),
    		 ticks(outputs('Get_file_properties')?['body/Modified'])
    		 ),100)
    	,1000000000)
     ,60
    )

    Output looks like this:

    lastModifiedResult.PNG

    So you can just follow that with a simple condition like:

    lastModifiedAction.PNG

     

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 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard