Power query looping (list.generate) - Rest Api pagination

Bajesh Balakrishnan 1 Reputation point
2021-11-04T18:11:23.047+00:00

Hi all,

Need some help here with Excel Power Query with function LIst.Generate.

I need to call a rest endpoint recursively until no more data is fetched. The issue here is that total number of pages is unknown and there is no next page key available.

I did try List.Generate function based on other posts but did not succeed, as it was giving me N number of records as the exit condition was not getting satisfied. ( [Results] <> null ).

Would really appreciate if you could give me a sample LIst.Generate function with api call being used.

Note : Attached screenshot shows the results of calls being made to api. There are 3 records, First call fetch 2 records, second call fetches 1 record and the third call is empty.

Thanks in advance.

scr146661-screenshot.jpg

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,772 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dave Patrick 426K Reputation points MVP
    2021-11-04T19:32:40.587+00:00

    Power query is not currently supported here on Q&A. The product group for Power Query actively monitors questions over at
    https://community.powerbi.com/t5/Power-Query/bd-p/power-bi-services

    --please don't forget to Accept as answer if the reply is helpful--

    0 comments No comments