cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lshneier
Helper I
Helper I

prevent flow from triggering if it recently successfully ran

I have asked our central finance team to drop files that we are meant to be sent but the report filler forgets into a our regions SharePoint folder. I then set a flow, to tell me when new items are in this folder so I can move them into the correct archive locations. The issue I have is the amount of files that would get uploaded is variable, it should be about 17 a month but sometimes people don't send a report in, or adhoc reports get added after the big batch of reports gets moved into the archive folder.

 

Currently I have the trigger condition of the flow being if the folder list in questions is greater than 15 message me on teams (can't use email alerts due to admin policies). However, I want to reduce this number to 0 but not get tons of messages on teams when the bulk upload of files happen. 

 

I assume I should be able to put in a condition on the flow that says something along the lines of if flow triggered successfully in past half hour stop running the flow otherwise continue (which would then trigger the message to hit teams. however my knowledge of power automate is very limited as i tend to work in excel more than anything else so have no idea how to accomplish this. 

 

Any advice you could offer would be great, do let me know if screenshots etc are needed.  This Flow is being created in the web app if that makes a difference as that is all i have access to.

1 ACCEPTED SOLUTION

Accepted Solutions
eliotcole
Super User
Super User

A simple solution to your current issue is have a SharePoint list which monitors flow runs.

Report Identity Based Check

I'm going to assume that there is at least one identifying piece of information for each file that helps you discern what it's for. So in this example I am pretending that for each report, they create a folder for it.

 

First up, create the SharePoint (or Microsoft) List, with a 'folderid' and 'foldername' column, and you can use the 'Title' column to either repeat the foldername, or if you like do something special.

 

Then for each run:

  1. The first action is a filter on the monitor list to see if this folder item was added/modified in the last 30m.
  2. If not, check if it exists at all, and either modify an existing item, or create an item, with the folder's ID and name.
  3. If so, terminate the flow.

 

This will still mean that the flow runs on each new item, but it will halt the notifications if something has just been done.

 

You can also add more information to this about how many files are there, or file properties, etc.

 

---

Alternative Method - Trigger Conditions or Flow Management Actions

There is almost definitely a way to use a just stop a flow triggering using trigger conditions to check for previous runs. However I don't have time to research that for you right now. But see what you can find, or maybe another user here will advise on it.

 

Alternatively, you can use the MS Power Automate management flows to check on flows, and achieve the same things that I detailed in my main solution without a SharePoint list. However the flow would still be running, and you might miss out on the additional management information you could gather on the habits from the SharePoint list. But it's doable. Play with the PA management flow actions if you have access to them.

 

---

Separately - Information / Business Process Management

Finally, and purely thinking aloud (not suggesting that you're doing anything wrong) ... perhaps a different approach to the business process here could benefit you. I would ask yourself the question:

Are these reports necessarily already the right place for the data to be in?

 

If the data that they carry could be kept in a SharePoint list, then reports would literally never need to be made. People would always know the current data that they need at a glance.

 

This would mean that anyone that needs to see the data that would normally be in an excel file could:

  • Look at a list view (general or personalised) of the data on a SharePoint site.
  • Have the data imported into a separate, departmentally own (and potentially protected) SharePoint List.
  • Have it converted into an excel sheet for legacy purposes (or personal viewing preferences).
  • Have it fed via API into relevant applications automatically.

 

This would mean that you don't need a complex folder and storage structure for information that might well be better kept in a list format anyway. Plus, once it's there, anyone that does still need an excel file for some reason can have that. 🙂

View solution in original post

4 REPLIES 4
eliotcole
Super User
Super User

A simple solution to your current issue is have a SharePoint list which monitors flow runs.

Report Identity Based Check

I'm going to assume that there is at least one identifying piece of information for each file that helps you discern what it's for. So in this example I am pretending that for each report, they create a folder for it.

 

First up, create the SharePoint (or Microsoft) List, with a 'folderid' and 'foldername' column, and you can use the 'Title' column to either repeat the foldername, or if you like do something special.

 

Then for each run:

  1. The first action is a filter on the monitor list to see if this folder item was added/modified in the last 30m.
  2. If not, check if it exists at all, and either modify an existing item, or create an item, with the folder's ID and name.
  3. If so, terminate the flow.

 

This will still mean that the flow runs on each new item, but it will halt the notifications if something has just been done.

 

You can also add more information to this about how many files are there, or file properties, etc.

 

---

Alternative Method - Trigger Conditions or Flow Management Actions

There is almost definitely a way to use a just stop a flow triggering using trigger conditions to check for previous runs. However I don't have time to research that for you right now. But see what you can find, or maybe another user here will advise on it.

 

Alternatively, you can use the MS Power Automate management flows to check on flows, and achieve the same things that I detailed in my main solution without a SharePoint list. However the flow would still be running, and you might miss out on the additional management information you could gather on the habits from the SharePoint list. But it's doable. Play with the PA management flow actions if you have access to them.

 

---

Separately - Information / Business Process Management

Finally, and purely thinking aloud (not suggesting that you're doing anything wrong) ... perhaps a different approach to the business process here could benefit you. I would ask yourself the question:

Are these reports necessarily already the right place for the data to be in?

 

If the data that they carry could be kept in a SharePoint list, then reports would literally never need to be made. People would always know the current data that they need at a glance.

 

This would mean that anyone that needs to see the data that would normally be in an excel file could:

  • Look at a list view (general or personalised) of the data on a SharePoint site.
  • Have the data imported into a separate, departmentally own (and potentially protected) SharePoint List.
  • Have it converted into an excel sheet for legacy purposes (or personal viewing preferences).
  • Have it fed via API into relevant applications automatically.

 

This would mean that you don't need a complex folder and storage structure for information that might well be better kept in a list format anyway. Plus, once it's there, anyone that does still need an excel file for some reason can have that. 🙂

Hi Sorry,

 

for the delayed response i got side tracked trying to get a macro on a different project to work as i knew it'd be a couple of weeks before the team that uploads files into the folder my flow tracks would give me the latest files. i have however, managed to get the reduction of notifications done based the list and then a past time step to create the within x time loop as you suggested in your solution.

 

 I'm still currently having to manually define the ID column in the list filter (currently set to greater than 32 as that only picks up this months items. However, i was wondering if you had any idea how i could set this to pull just the max list ID rather than a set variable which will progressively pull more and more lines. 

If you have created the monitor list with a field that is specifically set to hold the library file ID (which is the same as a list item number), then you can make that field require unique values.

 

Then you can Get items, filter by that column using the File's Library ID number, it will return one result (in an array). From there you can just pick out the fields that you want using the expression builder. When you're in there, select the body of the Get items, place a '[0]' after it, then a question mark, and the field name inside quotes and square brackets. Like this:

body('Get items')[0]?['FieldName']

That zero picks the first item from the one item array, then the ? means you're querying it and in that query you're asking for the 'FieldName' value.

Thanks after a lot of searching through setting sub menus I think my admin team have blocked me from adding in the document ID column for our sites. However during this process I was able to work out that as I did have the standard ID column that is automatically added to with the sequentially next number i.e. 1 2 3 etc. I could just order the get items by this field in descending order for the top item and achieve the same result of pulling the max item out. thank you for your help in this process

 

I am not 100% if this is what you meant in your reply. However, this seems to remove the need for a filter criteria and ensures that only the most recent relevant items get passed into the rest of the flow. 

Helpful resources

Announcements

Calling all User Group Leaders and Super Users! Mark Your Calendars for the next Community Ambassador Call on May 9th!

This month's Community Ambassador call is on May 9th at 9a & 3p PDT. Please keep an eye out in your private messages and Teams channels for your invitation. There are lots of exciting updates coming to the Community, and we have some exclusive opportunities to share with you! As always, we'll also review regular updates for User Groups, Super Users, and share general information about what's going on in the Community.     Be sure to register & we hope to see all of you there!

April 2024 Community Newsletter

We're pleased to share the April Community Newsletter, where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members.   If you're new to the Community, please make sure to follow the latest News & Announcements and check out the Community on LinkedIn as well! It's the best way to stay up-to-date with all the news from across Microsoft Power Platform and beyond.    COMMUNITY HIGHLIGHTS   Check out the most active community members of the last month! These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, follow these awesome community members to see what they do!   Power AppsPower AutomateCopilot StudioPower PagesWarrenBelzDeenujialexander2523ragavanrajanLaurensMManishSolankiMattJimisonLucas001AmikcapuanodanilostephenrobertOliverRodriguestimlAndrewJManikandanSFubarmmbr1606VishnuReddy1997theMacResolutionsVishalJhaveriVictorIvanidzejsrandhawahagrua33ikExpiscornovusFGuerrero1PowerAddictgulshankhuranaANBExpiscornovusprathyooSpongYeNived_Nambiardeeksha15795apangelesGochixgrantjenkinsvasu24Mfon   LATEST NEWS   Business Applications Launch Event - On Demand In case you missed the Business Applications Launch Event, you can now catch up on all the announcements and watch the entire event on-demand inside Charles Lamanna's latest cloud blog.   This is your one stop shop for all the latest Copilot features across Power Platform and #Dynamics365, including first-hand looks at how companies such as Lenovo, Sonepar, Ford Motor Company, Omnicom and more are using these new capabilities in transformative ways. Click the image below to watch today!   Power Platform Community Conference 2024 is here! It's time to look forward to the next installment of the Power Platform Community Conference, which takes place this year on 18-20th September 2024 at the MGM Grand in Las Vegas!   Come and be inspired by Microsoft senior thought leaders and the engineers behind the #PowerPlatform, with Charles Lamanna, Sangya Singh, Ryan Cunningham, Kim Manis, Nirav Shah, Omar Aftab and Leon Welicki already confirmed to speak. You'll also be able to learn from industry experts and Microsoft MVPs who are dedicated to bridging the gap between humanity and technology. These include the likes of Lisa Crosbie, Victor Dantas, Kristine Kolodziejski, David Yack, Daniel Christian, Miguel Félix, and Mats Necker, with many more to be announced over the coming weeks.   Click here to watch our brand-new sizzle reel for #PPCC24 or click the image below to find out more about registration. See you in Vegas!       Power Up Program Announces New Video-Based Learning Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram. These include a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the image below to find out more!   UPCOMING EVENTS Microsoft Build - Seattle and Online - 21-23rd May 2024 Taking place on 21-23rd May 2024 both online and in Seattle, this is the perfect event to learn more about low code development, creating copilots, cloud platforms, and so much more to help you unleash the power of AI.   There's a serious wealth of talent speaking across the three days, including the likes of Satya Nadella, Amanda K. Silver, Scott Guthrie, Sarah Bird, Charles Lamanna, Miti J., Kevin Scott, Asha Sharma, Rajesh Jha, Arun Ulag, Clay Wesener, and many more.   And don't worry if you can't make it to Seattle, the event will be online and totally free to join. Click the image below to register for #MSBuild today!   European Collab Summit - Germany - 14-16th May 2024 The clock is counting down to the amazing European Collaboration Summit, which takes place in Germany May 14-16, 2024. #CollabSummit2024 is designed to provide cutting-edge insights and best practices into Power Platform, Microsoft 365, Teams, Viva, and so much more. There's a whole host of experts speakers across the three-day event, including the likes of Vesa Juvonen, Laurie Pottmeyer, Dan Holme, Mark Kashman, Dona Sarkar, Gavin Barron, Emily Mancini, Martina Grom, Ahmad Najjar, Liz Sundet, Nikki Chapple, Sara Fennah, Seb Matthews, Tobias Martin, Zoe Wilson, Fabian Williams, and many more.   Click the image below to find out more about #ECS2024 and register today!     Microsoft 365 & Power Platform Conference - Seattle - 3-7th June If you're looking to turbo boost your Power Platform skills this year, why not take a look at everything TechCon365 has to offer at the Seattle Convention Center on June 3-7, 2024.   This amazing 3-day conference (with 2 optional days of workshops) offers over 130 sessions across multiple tracks, alongside 25 workshops presented by Power Platform, Microsoft 365, Microsoft Teams, Viva, Azure, Copilot and AI experts. There's a great array of speakers, including the likes of Nirav Shah, Naomi Moneypenny, Jason Himmelstein, Heather Cook, Karuana Gatimu, Mark Kashman, Michelle Gilbert, Taiki Y., Kristi K., Nate Chamberlain, Julie Koesmarno, Daniel Glenn, Sarah Haase, Marc Windle, Amit Vasu, Joanne C Klein, Agnes Molnar, and many more.   Click the image below for more #Techcon365 intel and register today!     For more events, click the image below to visit the Microsoft Community Days website.      

Tuesday Tip | Update Your Community Profile Today!

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   We're excited to announce that updating your community profile has never been easier! Keeping your profile up to date is essential for staying connected and engaged with the community.   Check out the following Support Articles with these topics: Accessing Your Community ProfileRetrieving Your Profile URLUpdating Your Community Profile Time ZoneChanging Your Community Profile Picture (Avatar)Setting Your Date Display Preferences Click on your community link for more information: Power Apps, Power Automate, Power Pages, Copilot Studio   Thank you for being an active part of our community. Your contributions make a difference! Best Regards, The Community Management Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Super User of the Month | Ahmed Salih

We're thrilled to announce that Ahmed Salih is our Super User of the Month for April 2024. Ahmed has been one of our most active Super Users this year--in fact, he kicked off the year in our Community with this great video reminder of why being a Super User has been so important to him!   Ahmed is the Senior Power Platform Architect at Saint Jude's Children's Research Hospital in Memphis. He's been a Super User for two seasons and is also a Microsoft MVP! He's celebrating his 3rd year being active in the Community--and he's received more than 500 kudos while authoring nearly 300 solutions. Ahmed's contributions to the Super User in Training program has been invaluable, with his most recent session with SUIT highlighting an incredible amount of best practices and tips that have helped him achieve his success.   Ahmed's infectious enthusiasm and boundless energy are a key reason why so many Community members appreciate how he brings his personality--and expertise--to every interaction. With all the solutions he provides, his willingness to help the Community learn more about Power Platform, and his sheer joy in life, we are pleased to celebrate Ahmed and all his contributions! You can find him in the Community and on LinkedIn. Congratulations, Ahmed--thank you for being a SUPER user!

Tuesday Tip: Getting Started with Private Messages & Macros

Welcome to TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   This Week's Tip: Private Messaging & Macros in Power Apps Community   Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member!   Our Knowledge Base article about private messaging and macros is the best place to find out more. Check it out today and discover some key tips and tricks when it comes to messages and macros:   Private Messaging: Learn how to enable private messages in your community profile and ensure you’re connected with other community membersMacros Explained: Discover the convenience of macros—prewritten text snippets that save time when posting in forums or sending private messagesCreating Macros: Follow simple steps to create your own macros for efficient communication within the Power Apps CommunityUsage Guide: Understand how to apply macros in posts and private messages, enhancing your interaction with the Community For detailed instructions and more information, visit the full page in your community today:Power Apps: Enabling Private Messaging & How to Use Macros (Power Apps)Power Automate: Enabling Private Messaging & How to Use Macros (Power Automate)  Copilot Studio: Enabling Private Messaging &How to Use Macros (Copilot Studio) Power Pages: Enabling Private Messaging & How to Use Macros (Power Pages)

Users online (4,789)