cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PradipTrainer
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
efialttes
Super User III
Super User III

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

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
efialttes
Super User III
Super User III

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

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
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (86,248)