Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
3 years ago
Solved

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...
  • Syndicate_Admin's avatar
    3 years ago

    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}),