cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jgriebel Advocate I
Advocate I

HTTP API call not running/working within for each

Hi, 

 

I build a flow which calls an API URL, when I create the link manually for one item via Compose function it is working.

when I move the same elements within the "for each" it is not working.

 

I started building this fow with just one http call, when I later added a SharePoint list as source to run the same for multiple items it generates the usual for each section. 
I build up the same link for the API within the "for each" via Compose from the SharePoint list but it is not working there.

also when I move the manual created link witin the "for each" it is not working while it was working outside of it.

 

before the "for each": 

image.png

 

when the same is called within the "for each": 

image.png

 

 

I tried also to move the manual composed link within the for each whith same result as for the link created from the SharePoint list, so the Status code 302 only appears if the HTTP function is called within the "for each" but working if it is called outside the "for each".

 

 

2 REPLIES 2
Community Support
Community Support

Re: HTTP API call not running/working within for each

Hi @jgriebel,

 

Before the HTTP action, please add a Parse JSON action. Then in the HTTP action, use Get method to receive the returned values.

 

Hope this blog could be a reference for you.

http://johnliu.net/blog/2017/10/convert-sharepoint-files-to-pdf-via-flow

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jgriebel Advocate I
Advocate I

Re: HTTP API call not running/working within for each

I have followed your suggestion but without success. I added the Prase JSON action to take the composed value and give it to the HTTP Action, still the same issue.

I have added the same also outside the for-each loop and there it is working fine.

 

image.png

 

 

I think the point is that this only fails if the action runs within a For-each-loop.

Outside the loop it is working as expected.

 

Both are using the exact same content and in this example the For-each-loop is manually triggered with an simple array of 2 items just to show the issue.

 

I build a work-around by using 2 Flows, one which go through the items with the for-each-loop and making an HTTP request to an other flow, which just handling one item at the time and caling the API via the HTTP action, this is working well, but needed 2 flows instead of one.

 

best regards

Jens Griebeler 

 

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Kudoed Authors
Users online (7,242)