cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
russrimm1
Helper I
Helper I

How to make my custom connector's API call retry until it gets a 200?

Hi all,

I'm  making a custom connector and one of my API calls I need to make is a POST which gets a value returned.  I then need to take that value and make a GET with it.  If you make the GET too quickly before the results are ready, you get 404's.  Once the result is ready, you get the result and a 200.  

I'm able to do this using a do until in Power Automate with no issues.  I'm wanting to do the same in my custom connector without relying on Power Automate if possible.  The problem is, I need it to keep retrying until it no longer gets the 404.  How do I make my PowerApp do the equivalent of what i'm doing in my flow with the do until so it will ignore the 404's and keep retrying until it gets the data with it's 200 returned?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks @PatrickMSFT I ended up getting it working by enabling the formula-level error management preview feature and setting the Repeat property of a timer to run my custom connector call inside an IsError() and it worked like a charm!

View solution in original post

2 REPLIES 2
PatrickMSFT
Microsoft
Microsoft

russrimm1,

 

I'm concerned this may not be available right now:
https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Error-handling-inside-PowerApps-Try-Catch/idi-p...

 

This thread doesn't touch on your specific issue but it covers a lot, obviously the notable point being error handling. We actually have implemented some error handling for formulas in Power Apps. There are some cool solutions in the comments that may help get you on track, too.

 

For more on error handling:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-iferror 
https://powerapps.microsoft.com/en-us/blog/new-feature-error-handling-and-writing-null-values-to-dat...

 

IfError() does let you catch an error and then take another action but as the first link notes, some things are still in development yet.

 

Most guidance seems centered around having your app call to a Flow in Power Automate, which it sounds like you're already familiar with.

 

One more quick add with a similar approach:
https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-do-Try-Catch-in-PowerApps-on-a-AzureB...

 

I hope this helps!

 

Patrick

Thanks @PatrickMSFT I ended up getting it working by enabling the formula-level error management preview feature and setting the Repeat property of a timer to run my custom connector call inside an IsError() and it worked like a charm!

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (70,042)