Forum Discussion
helspaul
9 months agoFrequent Visitor
API pagination which will work on Power BI Service
I'm trying to call paginated API data, publish that PBIX to the Power BI Service and have it still work. I found this site How to Handle API Pagination in Power BI - Syntera, tested the example code ...
- 9 months ago
Hey, helspaul
first of all, split the url, so that the it's only uptil the teamwork.com part, the rest should be inside RelatiVEpath.
Every API can handle pagination differently, I built most common approaches and how to deal with them here:
Your approach is similar to the JIRA Offset I wrote about, feel free to check it out, I put a snippet from there here for quicker access:populatePagesLG = List.Generate(
()=> 0,
(page) => page <= totalPages,
(page) => page + 1,
(page) => request(page * pageSize, pageSize)
),Before that tho, built pages:
request = (offset as number, limit as number) =>Json.Document(Web.Contents([RelativePath="/rest/api/3/search?jql=project=BI",Query =[startAt=Text.From(offset),maxResults=Text.From(limit)],Headers=[Authorization=basic_auth_string]]))getTotal = request(0, 0)[total]pageSize = 100totalPages = Number.RoundDown( getTotal / pageSize )
v-tejrama
9 months agoCommunity Support
Hi helspaul ,
Thank you vojtechsima for the response provided!
Has your issue been resolved? If the response provided by the community member addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.
Thank you for your understanding!