web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / HTTP 404 Error Handlin...
Power Automate
Unanswered

HTTP 404 Error Handling: Apply To Each

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

 

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

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

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

     

    image.pngimage.png

  • sumak Profile Picture
    Microsoft Employee on at

    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 Profile Picture
    25 on at

    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

  • NiloferA Profile Picture
    on at

    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 Profile Picture
    25 on at
    What if I'm not doing a loop and there will only be one record at a time?
  • NiloferA Profile Picture
    on at

    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 Profile Picture
    25 on at
    Terminate! that's what was missing. thanks so much.
  • NiloferA Profile Picture
    on at

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

  • Verceti87 Profile Picture
    44 on at

    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.

  • PrinellaCyber Profile Picture
    2 on at

    My flow is almost exactly like this except that instead of the HTTP3 request, I have a get item SharePoint action. I understand that it will not work in some cases so I set up my flow to send a Teams message and then terminate the flow.

     

    However, when the get item fails, the "post message in chat or channel" does not run and the terminate action is skipped even after I configured the run after to only when the SharePoint get item action fails. 

     

    I have attached a picture of the flow below. 

     

    image.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 238 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 225

#3
Haque Profile Picture

Haque 181

Last 30 days Overall leaderboard