Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
I have an API data source that returns 1 record and it uses cursor pagination. But I am new to Power BI and can't figure out how to do a response call to look up the next record and so on if more.
Can someone assist, have tried multiple options but none seem to work
HI @Anonymous ,
I think query paginated should suitable for your requirements. You can check at the following document or write a custom function with an iterator to merge each result and invoke web API with next cursor key:
Sample:
let
GetListByCurrsor=(rootpath as text,apikey as text, size as number,optional _currsor as text, optional resultList as list) as list=>
let
Source=if
_currsor<>null
then
Json.Document(Web.Contents(rootpath&"&"&_currsor,[Header=[#"XXX-Api-Key"=apikey]]))
else
Json.Document(Web.Contents(rootpath,[Header=[#"XXX-Api-Key"=apikey]])),
Result=if
resultList<> null
then
if
List.Count(resultList)<size
then
@GetListByCurrsor(rootpath,apikey,size,Source[currsor], List.Combine({resultList,Source[events]}))
else
resultList
else
@GetListByCurrsor(rootpath,apikey,size,Source[currsor],Source[events])
in
Result
in
GetListByCurrsor
Comment: rootpath is API URL, apikey is the header optional parameter, size is the max size of the result, _cursor is cursor key, resultList is the list store and merge result.
Regards,
Xiaoxin Sheng