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

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
Highlighted
Frequent Visitor

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

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
Highlighted
Community Support
Community Support

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.

Highlighted
Frequent Visitor

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

Highlighted
Super User III
Super User III

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

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
Top Kudoed Authors
Users online (7,358)