cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Schedule flow for specific number of times

Hi Team,

 

I would like to know if there is a way to limit the schedule flow to a specific number of times. 

 

Let's say I have a flow that runs every day. I would like it to run 10 times and then stop. Please help. 

 

Thanks.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Re: Schedule flow for specific number of times

Hi!

You mean a recurrence trigger based flow?

You can store nr of executions in an external repository (excel, CDS, sharepoint list, etc)

Now, everytime your triggee is executed, first step is to read the counter from external repository, then increment its value, add a Condition action block to evaluate if new counter value is greater than 10, now on the true branch add a Terminate action block. At the bottom of the flow, just after the Condition action block, place your current logic.

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Highlighted
Dual Super User III
Dual Super User III

Re: Schedule flow for specific number of times

Hi again!

There is another approach without an externañ repository. So if you know the first date your flow is to be execute, you can design your flow to calculate current date execution by means of utcNow() wdl expression, then taking start date as reference, check if current date execution is the same or any of the 9 following days.

THis second approach is better explained here

https://powerusers.microsoft.com/t5/General-Power-Automate/Flow-to-send-an-email-in-outlook-365/m-p/...

 

In this case you can even move this logic to the trigger, by means of conditional trigger functionality... so if the condition is not met flow will not be executed. GReat explanation here

https://www.timlinenterprises.com/microsoft-power-automate-flow-trigger-conditions/

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

2 REPLIES 2
Highlighted
Dual Super User III
Dual Super User III

Re: Schedule flow for specific number of times

Hi!

You mean a recurrence trigger based flow?

You can store nr of executions in an external repository (excel, CDS, sharepoint list, etc)

Now, everytime your triggee is executed, first step is to read the counter from external repository, then increment its value, add a Condition action block to evaluate if new counter value is greater than 10, now on the true branch add a Terminate action block. At the bottom of the flow, just after the Condition action block, place your current logic.

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Highlighted
Dual Super User III
Dual Super User III

Re: Schedule flow for specific number of times

Hi again!

There is another approach without an externañ repository. So if you know the first date your flow is to be execute, you can design your flow to calculate current date execution by means of utcNow() wdl expression, then taking start date as reference, check if current date execution is the same or any of the 9 following days.

THis second approach is better explained here

https://powerusers.microsoft.com/t5/General-Power-Automate/Flow-to-send-an-email-in-outlook-365/m-p/...

 

In this case you can even move this logic to the trigger, by means of conditional trigger functionality... so if the condition is not met flow will not be executed. GReat explanation here

https://www.timlinenterprises.com/microsoft-power-automate-flow-trigger-conditions/

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Users online (6,824)