cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

HTTP 404 Error Handling: Apply To Each

 

I've seen a few other posts on this, but none seem to resolve my issue here. I'm looping through all users in an organization and calling their "manager" endpoint in Microsoft Graph. I understand that I'll get 404s when they don't have a manager, and so I set up what I expected to be the correct way to handle these.

 

I configured two "Run After" steps; one for "Has Failed" and one for "Successful". The "Has Failed" simply increments a counter; I don't need to necessarily do anything after the failure. The Success writes to an array, that will eventually get written to a file. I'm writing two files at the end, so I do have subsequent steps after the Apply To Each.

 

Do I have to have a step after the increment variable on the fail condition for it to continue?

 

MUgiIfD

9 REPLIES 9
Anonymous
Not applicable

For clarification, here are my "Run After" configurations:

 

image.pngimage.png

Hi, were you able to resolve this issue? I am trying to do something similar. TRying to read a row from excel to see if it exists or not and do certain actions in both cases. But on "has failed" action works but the flow is marked failed. Is there a way to fix this?

 

baaaailey
Frequent Visitor

I'm having the exact same problem except I tried to initialize and set a variable to check if it was null, but it still won't proceed once it gets that 404 manager not found error

Hi!

Apply to each will not proceed to the next action if the previous action failed.

If you want to keep going after a failure is encountered, you can simply insert the Apply to Each action within Do Until. Please refer below steps 

  1. I simply initialized an Integer variable with value 1
    1. NiloferA_4-1619176504308.png
  2. Add a Do Until Action, with following condition (The condition will always be true so the Apply to Each loop will go on even if any iteration fails)
  3. Add Apply to each action within Do Until 
    1. NiloferA_5-1619176589494.png
  4. See it in working here
    1. NiloferA_6-1619176638473.png

Hope this helps! Please post your questions if any.

baaaailey
Frequent Visitor

What if I'm not doing a loop and there will only be one record at a time?

Well then it's even simpler. You just need two branches, One for when the previous action is Successful and the other when the previous action has Failed.

In this case, when there is a failure, the actions in the Failed Branch will execute but the Status of the Flow will show as Failed because there was indeed a failure.

To avoid confusion here, at the end of the Failed Branch, you can add a Terminate action and set the Status to either "Successful" or "Cancelled".

NiloferA_1-1619204965170.png

baaaailey
Frequent Visitor

Terminate! that's what was missing. thanks so much.

Not a problem! 🙂 Please mark the response as a solution if you found it helpful.

Verceti87
Helper I
Helper I

Is there a solution for this if the HTTP request is inside an apply to each control? Cant use the terminate action in this case.

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,104)