cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AIUYM19
Advocate V
Advocate V

How to read response headers from Power Automate

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?

4 REPLIES 4
AIUYM19
Advocate V
Advocate V

Anyone?

 

...Bueller? ...Bueller?

alrez
Community Support
Community Support

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.

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?

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

 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

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 (4,336)