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 Apps / How to read response h...
Power Apps
Unanswered

How to read response headers from Power Automate

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

In my app, I have a screen with the following value in the OnVisible property.

UpdateContext({Loading: true, ErrorNotification: false});
Clear(Manifest);
IfError(
 Collect(Manifest, PowerAutomateFlow.Run(SelectedProgram.Name).Items),
 UpdateContext({ErrorNotification: true, ErrorCode: "B1"});
 Clear(Manifest)
);
UpdateContext({Loading: false})

When this runs, the response from PowerAutomateFlow.Run() will be either 200 (containing an Items array) or 502 (containing a custom error object). If the response is 200, I want to perform one action; if it's 502, I want to perform another.

 

When 200 is returned, this code works. However, when 502 is returned, PowerApps simply throws an error at PowerAutomateFlow.Run() and doesn't perform the error actions. What am I doing wrong?

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Anyone?

     

    ...Bueller? ...Bueller?

  • alrezac Profile Picture
    Microsoft Employee on at

    Hi,

     

    Looking through the code itself, it looks fine to me. I would guess that there is some kind of other issue going on in the PowerApp that is indirectly causing this issue. Without delving more into this its difficult to say for certain. I would probably recommend opening a ticket with Microsoft Support on this. I'll include a link below if you would like to go down that path. Otherwise if any other communities members have any ideas feel free to chime in.

     

    If you would like to create a ticket with Microsoft Customer Support here is a link on how to do so: https://docs.microsoft.com/en-us/power-platform/admin/get-help-support

     

    Regards,

     

    Alex

     

    -------

     

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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, @alrez.

     

    I think there is a special process I need to follow through my organization if I need to get in touch with Microsoft Support. So, I will open a ticket with my Service Desk to start that process.

     

    In the meantime, is there a better method I could be using in PowerApps for error handling? In Java, Visual Basic, and JavaScript (my three most-used languages), all three have some form of a

    try {
     ...
    } catch(Exception e) {
     ...
    }

    clause that I can use. Is

    IfError(
     [try clause],
     [catch clause]
    )

    the only form of structured error handling in PowerApps?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Here is a screenshot of the error thrown by PowerApps. When this occurs, I want the actions in the second argument of my IfError() clause to be performed. However, PowerApps stops processing my code immediately upon throwing that error.

    Screenshot 2021-03-16 153116.jpg

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard