cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RCB
Level: Powered On

Restrict triggered flow to one execution per day.

I am creating a triggered flow that should be restricted from running more than once per day.  

 

Our IT team sends out an email that reports on several systems' load status, and when the systems I am concerned with are all flagged [complete] my flow kicks off a number of reports in PowerBI.

 

However, the status email continues to circulate, and the flow is triggered on every subsequent message.  This creates lots of unnecessary refreshes.  I'd like to in a limiter to keep the flow from executing more than once a day.   I discovered 'delay until' and wondered whether, after successfully requesting the PowerBI report refresh, I could 'delay until' midnight and prevent further executions on the current day.  

 

Is this an effecient or appropriate solution?  Is there some other way to disable a flow after execution and reenable starting midnight tomorrow morning?  I suppose I could also keep a log file somewhere and try to write out a history of some kind and then refer to the log to determine if the flow has already run in a day.  But I'm hoping to keep the flow more or less self-contained and not use any other files for tracking.

5 REPLIES 5
Super User
Super User

Re: Restrict triggered flow to one execution per day.

Hi @RCB you can use a Recurrence schedule and set it to run once a day at whatever time you select in your time zone.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

RCB
Level: Powered On

Re: Restrict triggered flow to one execution per day.

Thanks, @RobElliott for your reply.

 

Unfortunately, a regularly scheduled report is not sufficient.  The reports must be run as soon as the data is available, and that is the purpose of setting up a triggered flow.  Otherwise, PowerBI could run a refresh on a dialy schedule all on its own.

 

The status email can be circulated many times before and after all relevant systems are completely loaded.  The goal is to trigger the flow on the first and only the first time the email meets all requirements. 

Highlighted
Super User
Super User

Re: Restrict triggered flow to one execution per day.

Ah right, sorry. In that case the delay until might well be the best option.

Rob
Los Gallardos

Super User
Super User

Re: Restrict triggered flow to one execution per day.

@RCB @RobElliott 

While I don't have a full understanding of your requirement, I don't believe that a delay until will work for you.  The delay until will stop a given instance of a Flow form proceeding, it will not stop additional instances of the Flow from being triggered.

 

I believe that you'll need to store the date/time of when the Flow executed somewhere (SharePoint?).  When the Flow starts, check the date/time that the Flow last ran.  Use a condition and if the Flow should not proceed, use a control terminate action (with success) to exit the Flow.  If the Flow should proceed, update the date/time that the Flow last ran.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
Super User
Super User

Re: Restrict triggered flow to one execution per day.

Hi @RCB 

As Scott has already pointed out, a delay until will not work in your scenario.

If you want to keep your Flow completely self contained then what you can do is make use of the Flow Management actions to turn Flows on and off. https://docs.microsoft.com/en-us/connectors/flowmanagement/#turn-off-flow

In your Flow that is triggered, add a final action that uses the Flow Management connector to turn itself off. This will prevent any further triggers being actioned. 

chrome_2019-06-03_17-05-03.png

In addition to this, create a seperate Flow that runs daily (using the recurrence trigger) at a specified time (midnight for example) that uses the Flow Management connector to turn the Flow back on again.

This should ensure that it only ever runs once per day and you won't need to store/maintain values in any other external locations.

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 57 members 4,884 guests
Please welcome our newest community members: