web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help! Loop through HTT...
Power Automate
Unanswered

Help! Loop through HTTP REST API, collect multiple pages of results and append into a single array

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

 

Problem: REST API has a limit of 500 results per page, therefore looping through multiple pages to get all results. So far so good, however now I need to store all results into a single array to continue my flow logic. Currently testing with 3 pages of 15 results each, but will need to go up to 10 pages of 500 results each. Hence trying to avoid the apply to each command due to Power Automate limits.

 

In steps the flow does the following:

  1. Set Pages to 3 (to loop through 3 pages)
  2. Set PageNumber to 0 (used for loop, will be incremented)
  3. Initialize a STRING variable (to append all HTML BODY to later)
  4. Start "Do Until" loop
    1. Increase PageNumber to 1
    2. HTTP GET command for Page 1, 15 results
    3. Append HTML BODY
  5. Parse JSON from KnowBe4Data, this step goes WRONG, it will only show 15 results.. not 45
  6. However, when I create a CSV table of the same JSON, I get 45 results..?

 

Does anyone know a way to add all pages into a single variable so I can pick that up for the rest of the flow?

Preferable without the 'apply to each' to avoid reaching limits (total 3000+ records)

 

klymvdm_0-1669993292913.png

klymvdm_1-1669993329714.png

klymvdm_2-1669993675457.png

 

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Update: I guess I know why it goes wrong, the parse JSON only picks up the first 15 as there is a closing block ']' before the next set of results.

    klymvdm_0-1669994929809.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Update 2: Solved it with a compose action, not the prettiest but it works. Very much open for ideas about improving this.

     

    replace(variables('KnowBe4Data'), '][', ',')

     

    klymvdm_0-1669995422271.png

     

  • Pstork1 Profile Picture
    69,649 Most Valuable Professional on at

    If you can get each array from the HTTP call then you can use union() to combine them in one step.  YOu may still need to add comma's after the closing braces to get an array of arrays that you can use union() on.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 293 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 186 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 144 Super User 2026 Season 2

Last 30 days Overall leaderboard