Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

Needs some help with RelativePath when using a Headers =[]

I have the following source section of my query, which runs fine, but I'm trying to use RelativePath methodology so I can set up automatic refreshes in PBI service

 

let
    Source = (page as text) as table =>
let
    Source = Json.Document(Web.Contents("https://api.harvestapp.com/v2/invoices?per_page=2000&page="&(page), [Headers=[Authorization="**mykey**", #"Harvest-Account-Id"="******", #"User-Agent"="****"]])),
    #"Converted to Table" = Table.FromRecords({Source}),

 

But the various resources I used when trying to use the relative path method didn't show any examples that also have a headers section like mine does. I assume I can probably rework my headers section, but i'm not sure where to start, this is what i ended up with after trying some tutorials, but I get errors that too many arguments are being passed into the function

 

let
    Source = (page as text) as table =>
let
    Source = Json.Document(Web.Contents("https://api.harvestapp.com/v2/invoices",
    [RelativePath ="?per_page=2000",
    Query = [page=(page)]], 
[Headers=[Authorization="**mykey**", #"Harvest-Account-Id"="******", #"User-Agent"="****"]])),
    #"Converted to Table" = Table.FromRecords({Source}),

 

I tried a few different variations similar to this, like moving the per_page into the query section, and the like, but i get the same error, that too many parameters are passed. Any ideas or resources that will move me forward are greatly appreciated

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

I resolved this myself, i totally misunderstood the syntaxing here. 

 the below works in case anyone had to learn this for the first time like i did)

let
    Source = (page as text) as table =>
let
    Source = Json.Document(Web.Contents("https://api.harvestapp.com/v2/invoices",
    [RelativePath ="?per_page=2000",
    Query = [page=(page)], 
    Headers=[Authorization="**mykey**", #"Harvest-Account-Id"="******", #"User-Agent"="****"]])),
    #"Converted to Table" = Table.FromRecords({Source}),

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

I resolved this myself, i totally misunderstood the syntaxing here. 

 the below works in case anyone had to learn this for the first time like i did)

let
    Source = (page as text) as table =>
let
    Source = Json.Document(Web.Contents("https://api.harvestapp.com/v2/invoices",
    [RelativePath ="?per_page=2000",
    Query = [page=(page)], 
    Headers=[Authorization="**mykey**", #"Harvest-Account-Id"="******", #"User-Agent"="****"]])),
    #"Converted to Table" = Table.FromRecords({Source}),

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors