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

Run after "Has Failed" in an Apply To Each loop prevent execution of actions following Apply To Each

I have an Apply To Each that iterates through Document Sets in Sharepoint. For each Document Sets, I try to get the properties of a file. If it exists I update the file with new data. If not, I create the file. The file creation is put in an "Run After" clause of "Has Failed". It works. However, any action that I put after the "Apply To Each" action the fails to run. The Apply To Each is considered to have failed even though I managed the error condition.

 

Any way to make this work? I can't make my Apply To Each action the last one of my flow since I need to do some other things after.

1 ACCEPTED SOLUTION

Accepted Solutions
etfortin
Level: Powered On

Re: Run after "Has Failed" in an Apply To Each loop prevent execution of actions following Apply To Each

I actually found the problem. Here's the solution:

 

Essentially if a file does not exist it fail and I catch the fail condition in (1). However it prevented the last two actions to execute. So I added (2), ie managing the fail condition at the end of the Apply To Each.

 

So basically this problem comes from my lack of experience with flow and me thinking too much in terms of programming. Catching a Fail condition is therefore not a "catch exception", it's really a "catch / rethrow".

 

Capture.PNG

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Run after "Has Failed" in an Apply To Each loop prevent execution of actions following Apply To Each

@etfortin 

Please post a screen shot of your Flow - that will make it much easier to assist.

 

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

Scott
Community Support Team
Community Support Team

Re: Run after "Has Failed" in an Apply To Each loop prevent execution of actions following Apply To Each

Hi @etfortin ,

 

As @ScottShearer  asked, could you please share a screenshot of the configuration of your flow?

Are you configuring an action run after an action inside the "Apply to each"? 

 

Best regards,

Alice       

 

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

etfortin
Level: Powered On

Re: Run after "Has Failed" in an Apply To Each loop prevent execution of actions following Apply To Each

I actually found the problem. Here's the solution:

 

Essentially if a file does not exist it fail and I catch the fail condition in (1). However it prevented the last two actions to execute. So I added (2), ie managing the fail condition at the end of the Apply To Each.

 

So basically this problem comes from my lack of experience with flow and me thinking too much in terms of programming. Catching a Fail condition is therefore not a "catch exception", it's really a "catch / rethrow".

 

Capture.PNG

View solution in original post

Super User
Super User

Re: Run after "Has Failed" in an Apply To Each loop prevent execution of actions following Apply To Each

I'm glad you got it worked out.

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

Scott

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

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!

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 Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (5,621)