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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Hwielen
Frequent Visitor

Help needed with Power Query to get all records from a Rest API using a loop function

Hi there!

I'm just starting out with Power BI and I need to extract data from our online ticketing application to create some reports. I managed to create a query that returns some records with ticket data from selected fields of the past month.

My problem is that the API limits the results to 500 records. So I created a function with a loop to retrieve the rest of the records and combine these in one list. Apart from the 500 records the API returns an additional record with the number of returned records and two URLs. One URL for the previous block of 500 records and one URL to retrieve the next block of 500 records. If there are no more records the second URL returns NULL.

Link to the documentation of the Autotask REST API


I created a function that I call from the query. I did a query count and know there must be 916 records. I'm sure the URL for the next block is passed to the function correctly and I don't get any errors. But the resulting table still shows only 500 records.

I hope someone can tell me what am I doing wrong.

 

Resulting records first block.pngRecord with URL for next block.pngQuery.pngLoop Function.png

 

 

1 ACCEPTED SOLUTION
Hwielen
Frequent Visitor

I have got it working! 😀

This is the code i'm using now. It's also much cleaner.

Query

Query for tickets.png

 

Function get next records.png

View solution in original post

3 REPLIES 3
Hwielen
Frequent Visitor

I have got it working! 😀

This is the code i'm using now. It's also much cleaner.

Query

Query for tickets.png

 

Function get next records.png

Anonymous
Not applicable

Hi @Hwielen ,

 

Is there any documentation about this Api?

You need to check in the Dotdigital API documentation how to specify the offset when you request your data.
Solved: Api limit of 1000 records - getting the next 1000 ... - Microsoft Power BI Community

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

I have added a link to the documentation of the Autotask REST API for your information

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors