Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi,
I am trying to pull an API with multiple pages, I was able to create the reports on desktop. However, when I published to web service it will not allow me to create a schedule or to refresh it online because of the dynamic way I am pulling the pages. Is there anyone to pull the data without using the dynamic approach?
here is the query I am using
Report Pages:
let
Source = Json.Document(Web.Contents("https:/XXXXX?view=list", [Headers=[Authorization="Bearer XXXXX", Accept="*/*"]])),
#"Converted to Table" = Record.ToTable(Source),
Value = #"Converted to Table"{0}[Value],
Value1 = Value{0},
#"Converted to Table1" = Record.ToTable(Value1),
#"Transposed Table" = Table.Transpose(#"Converted to Table1"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"total_pages", Int64.Type}}),
total_pages = #"Changed Type"{0}[total_pages],
Custom1 = List.Numbers(1,total_pages,1),
#"Converted to Table2" = Table.FromList(Custom1, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type1" = Table.TransformColumnTypes(#"Converted to Table2",{{"Column1", type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Column1", "page"}})
in
#"Renamed Columns"
Data Function:
let
Source = Json.Document(Web.Contents("https:/XXXXX?view=list", [Headers=[Authorization="Bearer XXXXX", Accept="*/*"]])),
#"Converted to Table" = Record.ToTable(Source),
Value = #"Converted to Table"{0}[Value],
Value1 = Value{0},
#"Converted to Table1" = Record.ToTable(Value1),
#"Transposed Table" = Table.Transpose(#"Converted to Table1"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"total_pages", Int64.Type}}),
total_pages = #"Changed Type"{0}[total_pages],
Custom1 = List.Numbers(1,total_pages,1),
#"Converted to Table2" = Table.FromList(Custom1, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type1" = Table.TransformColumnTypes(#"Converted to Table2",{{"Column1", type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Column1", "page"}})
in
#"Renamed Columns"
Dataset:
let
Source = Json.Document(Web.Contents("https:/XXXXX?view=list", [Headers=[Authorization="Bearer XXXXX", Accept="*/*"]])),
#"Converted to Table" = Record.ToTable(Source),
Value = #"Converted to Table"{0}[Value],
Value1 = Value{0},
#"Converted to Table1" = Record.ToTable(Value1),
#"Transposed Table" = Table.Transpose(#"Converted to Table1"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"total_pages", Int64.Type}}),
total_pages = #"Changed Type"{0}[total_pages],
Custom1 = List.Numbers(1,total_pages,1),
#"Converted to Table2" = Table.FromList(Custom1, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type1" = Table.TransformColumnTypes(#"Converted to Table2",{{"Column1", type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Column1", "page"}}),
#"Invoked Custom Function" = Table.AddColumn(#"Renamed Columns", "Data", each #"Data function"([page]))
in
#"Invoked Custom Function"
@lbendlin
here is the code without the relative path part
view=list needs to move to the Query part.
The rest looks ok in Power Query Formatter. Still can't find the function call with the excess supplied parameters. Do you have a "Go to error" button?
- please clear out your Bearer token, you don't want that stuff on the interwebs.
- please read about RelativePath and Query options https://learn.microsoft.com/en-us/powerquery-m/web-contents
Thank you @lbendlin, for catching my token
yeah, I have been trying to use the Relative Path and query; I am lost when I go to the dataset, and invoke custom function, I am receiving an error, and the error is
An error occurred in the ‘’ query. Expression.Error: 3 arguments were passed to a function which expects between 1 and 2.
Details:
Pattern=
Arguments=[List]
and this where I am stuck
please show a sanitized version of your Power Query code.
@lbendlin, here is the query where I am getting the error and thank you so much for your help
Dataset:
let
Source = Json.Document(Web.Contents("https:/XXXXX?view=list", [Headers=[Authorization="Bearer XXXXX", Accept="*/*"]])),
#"Converted to Table" = Record.ToTable(Source),
Value = #"Converted to Table"{0}[Value],
Value1 = Value{0},
#"Converted to Table1" = Record.ToTable(Value1),
#"Transposed Table" = Table.Transpose(#"Converted to Table1"),
#"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"total_pages", Int64.Type}}),
total_pages = #"Changed Type"{0}[total_pages],
Custom1 = List.Numbers(1,total_pages,1),
#"Converted to Table2" = Table.FromList(Custom1, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type1" = Table.TransformColumnTypes(#"Converted to Table2",{{"Column1", type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Column1", "page"}}),
#"Invoked Custom Function" = Table.AddColumn(#"Renamed Columns", "AHA", each #"AHA function"([page])),
#"Expanded AHA" = Table.ExpandTableColumn(#"Invoked Custom Function", "AHA", {"Feature #", "Jira keyOC", "Jira IDOC", "Release name", "Release date", "Project assigned to", "Workspace name", "Epic name", "Project name", "External Title", "External Description", "Roadmap Visibility", "1H / 2H", "PillarOC", "Value StreamOC", "Pillar (Workspace line label)", "Product Group (Workspace line label)", "Product Line (Workspace line label)", "Value Stream (Workspace line label)", "Code freeze date", "Roll-up release name", "Readiness Priority", "Feature Impact Feature On or Off", "Feature Impact Personas Impacted by Default", "Jira key", "Pillar", "Value Stream", "Feature"}, {"Feature #", "Jira keyOC", "Jira IDOC", "Release name", "Release date", "Project assigned to", "Workspace name", "Epic name", "Project name", "External Title", "External Description", "Roadmap Visibility", "1H / 2H", "PillarOC", "Value StreamOC", "Pillar (Workspace line label)", "Product Group (Workspace line label)", "Product Line (Workspace line label)", "Value Stream (Workspace line label)", "Code freeze date", "Roll-up release name", "Readiness Priority", "Feature Impact Feature On or Off", "Feature Impact Personas Impacted by Default", "Jira key", "Pillar", "Value Stream", "Feature"}),
#"Removed Columns" = Table.RemoveColumns(#"Expanded AHA",{"page"}),
#"Removed Duplicates" = Table.Distinct(#"Removed Columns", {"Feature #"})
in
#"Removed Duplicates"
what's the code behind #"Data function" ?