Forum Discussion
Combine Rest API Pagination and Multiple Loops
Hi. Yes already tried the above function but it does not let me invoke the function. Instead shows error
.and also it does.nott work on blow query for pagination,
= list.generate (()=>
[Output = try Factivity (1) otherwise null, n=1]
Each [output] <> null,
Each [output = try Factivity ([n]+50) otherwise null, n=[n]+50],
Each [output])
Hi Anonymous ,
I think use function List.Generate in Power Query is a good way.
How to use List.Generate to make API Calls in Power Query M
Instead of pagination, you can also use List.Numbers along with Skip or Offset in the web calls to overcome the row limit. This video walks through it.
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.
- Anonymous4 years agoNot applicable
I have tried list. generate finction but it does not provide values. Also I have watched the tales from front video but it requires count of the API rows which i don't have.
- lbendlin4 years agoSuper User
You can use List.Generate to peek into the response and see if at a given offset no more data is returned.
You could also use recursive functions but these generally do not work well when you have to return a lot of data.
As you may imagine - without access to your API it is very difficult to help you with the code. That's a problem for any scenario that requires authentication/authorization. Pity that they don't have dummy/test user accounts.
- Anonymous4 years agoNot applicable
Hi lbendlin
PFB the summarized issue in the below link,
It has a video link through which you will be easily able to explain the the issue and provide solution.
https://community.powerbi.com/t5/Developer/Power-BI-Pagination-amp-Looping-using-List-Generate/m-p/2383290
Best,
Saad.