Forum Discussion
Anonymous
2 years agoNot applicable
Problem with GitLab API pagination in Power BI - Limited response size
Hello everyone, I am facing a problem with the integration of the GitLab API in Power BI. I am using the GitLab API to retrieve issues from our company and I am running into a limitation with pag...
- Anonymous2 years ago
Fixed it. Needed to set the header parameter "scope=all" as described in the api docs for gitlab: https://docs.gitlab.com/ee/api/issues.html
Anonymous
2 years agoNot applicable
Fixed it. Needed to set the header parameter "scope=all" as described in the api docs for gitlab: https://docs.gitlab.com/ee/api/issues.html
SaxonChuang
1 year agoNew Member
I my case the parameter scope=all is not work. here is a example for get all issues via power query.
let
// Base API URL (Replace {project_id} with your actual project ID)
BaseUrl = "https://gitlab.com/api/v4/projects/535/issues?per_page=100",
// Headers including the scope
Headers = [
#"PRIVATE-TOKEN" = "........."
],
// get single page
GetPage = (PageNum as number) =>
let
Url = BaseUrl & "&page=" & Number.ToText(PageNum),
Response = Web.Contents(Url, [Headers = Headers]),
JsonData = Json.Document(Response)
in
JsonData,
// loop all pages
GetAllIssues = List.Generate(
() => [PageNum = 1, Issues = GetPage(1)], // 開始從第 1 頁
each List.Count(_[Issues]) > 0, // 只要回傳不為空,繼續抓取
each [PageNum = _[PageNum] + 1, Issues = GetPage(_[PageNum] + 1)], // 取下一頁
each _[Issues] // 取出 issue 清單
),
// flat them
FlattenedIssues = List.Combine(GetAllIssues),
// turn to table
IssuesTable = Table.FromList(FlattenedIssues, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
IssuesTable