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

Make Rest call, use result to make the next one

Hello,

I'm making a custom connector, and one of the REST calls I make returns an ID number.  I then use that ID number to get the results.  

The issue is, each time I ask for the results before they're ready, I'll get a 404 which is expected, and when the results are ready I'll get a 200 with the result.  I'm able to make a do until Flow that loops until it gets a 200, but is there any way to do the same without using a Flow within my PowerApp?  I thought about using a timer, but I how long it'll take for the results to be ready is a bit unpredictable so I'd have to have it wait extra long just in case which is messy.  Any other options besides using a Flow?

 

Thx

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @russrimm1 :

You can use a timer to execute the loop and end the loop when you get the expected result.For example:

Add a timer control:

Duration

2000 /*loop in 2s*/

OnTimerEnd

Set(ThrVar,YourReturnID) /*ThrVar is my custom variable*/

Repeat

ThrVar<>200 /*As long as the value of the variable is not equal to 200, this timer will continue to loop*/

Best Regards,

Bof

View solution in original post

1 REPLY 1
v-bofeng-msft
Community Support
Community Support

Hi @russrimm1 :

You can use a timer to execute the loop and end the loop when you get the expected result.For example:

Add a timer control:

Duration

2000 /*loop in 2s*/

OnTimerEnd

Set(ThrVar,YourReturnID) /*ThrVar is my custom variable*/

Repeat

ThrVar<>200 /*As long as the value of the variable is not equal to 200, this timer will continue to loop*/

Best Regards,

Bof

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

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (17,139)