Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
imranamikhan
Helper V
Helper V

Return all rows from JSON Query

Hi everyone,

 

I am currently using the below to API call to a Dataverse table. Unfortunately, this results in only the first 500 rows being returned.

 

 

let
    Source = Web.Contents(https://xxx-prod-xxx.api.crm11.dynamics.com/api/data/v9.2/audits)
                in
    Source

 

 

I have found a potential solution below:

 

https://stackoverflow.com/questions/65631024/json-query-in-power-bi-only-returning-first-1000-rows-h... 

 

The solution first involves making a function to access the API:

 

let API = (relPath as text, optional queries as nullable record) =>
    let
        Source = Json.Document(Web.Contents(https://xxxx.api.crm4.dynamics.com/, 
            [ Query = queries, 
              RelativePath=relPath]))
    in
        Source
in 
    API

 

 

And then running another query using List.Generate to perform multiple calls to the API as required:

 

let
    Source = API("path/to/records", [rows_per_page="1000"]),
    pages = Source[total_pages],
    records = 
        if pages = 1 then Source[records] 
        else List.Combine(List.Generate(
            () => [page = 1, records = Source[records]], 
            each [page] <= pages, 
            (x) => [page = x[page] + 1, records = API("path/to/records", [page = Text.From(x[page] + 1), rows_per_page = "1000"])[records]], 
            each [records]))
in
    records

 

 

 

However, I am stuck at this part because I do not know how to modify the above for my scenario (my knowledge of this area is limited).

 

Could anyone advise or alternatively suggest a method for returning all rows?

 

------------------------------------------------------------------------------------------------------------------------------

 

If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

If you like my response, please give it a Thumbs Up.

Imran-Ami Khan || Power Platform Super User: Community Profile

1 ACCEPTED SOLUTION

Hi @imranamikhan ,

 

According to your statement, I think your requirement is to overcome API call row limit.

Please see this video for a good approach to do this.

Power BI - Tales From The Front - REST APIs - YouTube

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
imranamikhan
Helper V
Helper V

Hi @JoeBarry - the table in question is the Audits entity, which is not accesible via the Dataverse connector. It can be accessed however via a Web API.

Hi @imranamikhan ,

 

According to your statement, I think your requirement is to overcome API call row limit.

Please see this video for a good approach to do this.

Power BI - Tales From The Front - REST APIs - YouTube

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

JoeBarry
Solution Sage
Solution Sage

Hi @imranamikhan 

 

Is there anything from preventing you from using the Dataverse connector?  

JoeBarry_0-1692596455313.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.