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

Notifications

Announcements

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

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
    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
    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
    68,707 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard