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 / Prevent Multiple Insta...
Power Automate
Answered

Prevent Multiple Instances of a Flow and Reset Timer for Inactivity with File Uploads

(1) ShareShare
ReportReport
Posted on by 6

I am trying to create an automated flow that handles multiple file uploads to a folder and sends an email notification only after a period of inactivity. Here’s what I need help with: I want the flow to start when the first file is uploaded to the folder. After that, the flow should count the number of files uploaded to the folder. For example, if I upload 20, 30, or more files, the flow should count them all, but it should only send an email notification after 60 minutes of inactivity — meaning no new files uploaded during that time. If a new file is uploaded within that 60-minute period, the timer should reset and continue counting.

The goal is for the flow to continuously track new uploads, reset the timer if any new file is uploaded within the 60 minutes, and only send the email once no new files have been uploaded for 60 minutes.

I’m unsure of how to count the uploaded files continuously, reset the inactivity timer after every new file upload, and ensure only one instance of the flow runs without creating a new instance each time a file is uploaded.

Categories:
I have the same question (0)
  • Verified answer
    David_MA Profile Picture
    14,956 Super User 2026 Season 1 on at
    This isn't exactly what you are asking, but I don't know of another way to do what you want.
    1. Create a scheduled flow that runs every hour.
    2. Use a get items action with a filter query to get all files where the created date is greater than or equal to the current date/time less one hour.
    3. Use a length() expression to count how many files where created.
    4. I am not sure I follow what you want for notifications, but you can use a condition to send them. If the count is more than zero send one notification and if the count is zero send another notification.
    It will be interesting to see what folks come up with. Someone probably figured out how to do this. Good luck.
  • Suggested answer
    trice602 Profile Picture
    16,298 Super User 2026 Season 1 on at
    Hi there!
     
    I think you can use something like this.
     
     
    My fcount variable is set to
    length(body('List_folder')) and will count the number of files/folders in a folder.  So in my test I have 90.
     
    Next I am using a do until 1 does not equal 1 which means it will loop indefinitely until it times out.  I have mine set to 720 count, 30 days.
     
    Next I List folders again, count files and if the new count = variable fcount, send email
     
    Lastly, I update fcount using set var at the end and loop again after 60 mins.
     
    Manually triggered, you can quickly start and stop periodically as needed.
     

    ------------------------------------------------

     

     

    ⭐ If this was helpful, please like and check the box below "Does this answer your question" to help others find this too!

     

     

    Always glad to help! 💯💯💯💯💯

     

    Tom

     

    Follow me on LinkedIn - Thomas Rice, PMP | LinkedIn

     
     
  • CU05031218-0 Profile Picture
    6 on at
    @David_MA
    Thank you for sharing a different perspective to solve the issue. 
    I have set up a scheduled flow that keeps checking the "modified" and then filtered with who modified it. If both are true it will send the notification. 
     
    BR
    Talha

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard