cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SoAZ
Frequent Visitor

HTTP Request Does Not Work In Loops

I am trying to write a flow that loops through emails in an inbox, and makes a http get request based on the subject of the email. My get request works fine, but it gets skipped when put inside a loop (I have tried "Apply to Each" and "Do Until" loops).

 

The http request skips even when I only select the top "1" email, so it shouldn't be a delay issue. I have read that when an action is skipped and is faded, it means that proper input wasn't given. But in my examples, everything within the request is hardcoded, so there shouldn't be an issue of no input. 

 

Any advice would be greatly appreciated.

 

Looped get request:

Looped HTTP request.png

 

Un-looped get request:

Un-looped HTTP Request.png

3 REPLIES 3
eric-cheng
Solution Sage
Solution Sage

Hi @SoAZ ,

 

How strange.

 

Are you sure that there are emails being returned?  Could there be some filters set or folders selected which is causing no emails to be returned and hence, not looping? 

 

As a test, add a Compose action after Get Actions and use the below expression to verify emails are being returned

 

length(outputs('Get_emails_(V3)')?['body/value'])
 
ericcheng_0-1659003914801.png

 

I tested adding a HTTP action inside a loop with a public API and it should be working.

 

ericcheng_1-1659004026306.pngericcheng_2-1659004056077.png

 

 

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

 

 

 

 

Hi @eric-cheng , thank you for your help. I tried the compose action, and it does return a length of 1. 

 

I don't think it's an issue with the email, because I have the same problem when I use a "Do Until" loop as well, without using any of the outputs of the "Get Emails" action.

 

SoAZ_0-1659126142380.png

 

 

 

eric-cheng
Solution Sage
Solution Sage

Hi @SoAZ ,

 

Very strange.

 

Can you try switching your HTTP to a GET request and putting the below endpoint in and see if it does anything (similar to my screenshot)? Dont think it would make a difference but worth checking out.

 

https://pokeapi.co/api/v2/pokemon/ditto

 

PokéAPI (pokeapi.co)

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Kudoed Authors
Users online (3,299)