Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

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

(0) ShareShare
ReportReport
Posted on by

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

 

 

  • Pstork1 Profile Picture
    67,060 Most Valuable Professional on at
    Re: Help! Loop through HTTP REST API, collect multiple pages of results and append into a single array

    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.

  • Community Power Platform Member Profile Picture
    on at
    Re: Help! Loop through HTTP REST API, collect multiple pages of results and append into a single array

    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

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Help! Loop through HTTP REST API, collect multiple pages of results and append into a single array

    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

     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1