cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cfebvre
Kudo Collector
Kudo Collector

Stop flow after first true condition inside 'Do Until'

Hi all,

 

I have a flow with a 'Do Until' control with an incrementing integer set to '72'.

Within the 'Do Until' control, I have a condition control looking for a 'Name' match with a concatenation of a string combined with the integer.

 

There will only ever be 1 match out of the potential 72 in any run.

 

What I'd like to work out is a way to stop my flow after it finds the first true condition (after it runs the actions beneath the true condition).

 

I understand I can't use the Terminate action with a 'Do Until' tree, but is there something else I can do to stop it running?

 

___________________

Breakdown of the Flow

 

  • User exports a pdf with the automatically generated naming convention of '********'_Page021.pdf into Sharepoint Doc library.
  • Flow triggers when document is created or modified.
  • Flow gets file properties.
  • Flow gets file content
  • Flow initializes integer variable starting at 0.
  • Flow 'Does Until' Integer equals 72.
  • Flow Increments variable by 1.
  • Flow searches for condition - uploaded file name contains concat('_Page00', variables('Integer'), '_') - or '_Page0' if it finds no match.
  • Upon condition true, Flow Creates a File in a different library folder - 'Page(Current Integer)'.pdf.

*Then a couple more steps encased in the true condition not relevant to the question.*

 

Stop Flow 001.jpgStop Flow 002.jpgStop Flow 003.jpg

 

I find I'm needing to ask increasingly complicated questions, so apologies, and thanks in advance to anyone who can assist!

 

Cheers, Chris.

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @cfebvre ,

 

You could use Set variable action directly to set the variable value to 72 and the loop will end.

 

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-bacao-msft
Community Support
Community Support

 

Hi @cfebvre ,

 

You could use Set variable action directly to set the variable value to 72 and the loop will end.

 

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-bacao-msft

 

Thanks so much, this is exactly it!

 

Cheers,

 

Chris. 

Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,219)