Forum Discussion

PatrickArrastia's avatar
PatrickArrastia
Regular Visitor
3 years ago
Solved

Power Query and pagination

Hello, I am trying to paginate through an unknown number of pages. There is a value in the table called "end_of_stream", which I think could be used for this. Once there are no more pages the "end_o...
  • PhilipTreacy's avatar
    3 years ago

    Hi PatrickArrastia 

     

    Your problem is very similar to this one

     

    Solved: Need Help with Stripe REST API Pagination in Power... - Microsoft Power BI Community

     

    You can try this code which of course needs a little modification to include your URL

    let
        APICall = 
    
            List.Generate
            (  
                () => [ APIData = Json.Document(Web.Contents("insert subdomain.zendesk.com here")) , EndData = APIData[end_of_stream] ],
    
                each [EndData] = "FALSE",
               
                each [ APIData = Json.Document(Web.Contents("insert subdomain.zendesk.com here")) , EndData = [APIData][end_of_stream] ],
    
                each [APIData]
            )
    in
        APICall

     

    Regards

     

    Phil