Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Web.Contents - Desktop to Service

Hello Everyone,

 

I have been working on this for awhile, but I am just lacking a proper understanding of how Web.Contents is used between the Desktop and Service.  Here is my delima:

 

I have Power M query to iterate page by page from an API (thank you ImkeF for you wonderful assistance), which works just find from the Desktop.

let
WebAPI = "https://api.getdata.com/surveys/clientid/responses",
BearerToken= "Bearer XXXXXXXXXXXXXXXXX",
PageLimit = 20,
Pagination = List.Buffer(List.Generate( () => [WebCall=[], Page = 1, Counter = 0], 
   		each (try List.IsEmpty([WebCall][client_data])=false otherwise false or [Counter]=0) and [Page]<=PageLimit,
   		each [ WebCall = Json.Document(Web.Contents(WebAPI&"?per_page=100&page="&Text.From([Page]),[Headers=[Authorization=BearerToken]])), 
     			Page = [Page]+1,
     			Counter = [Counter]+1
]
))
in
    Pagination

 The troube begins when I publish to the Service and schedule the data for refresh: "Query contains unsupported function. Function name: Web.Contents".  I have a loose understanding that the base URL isn't being recognized as a data source in the Service, but I do not know how to format the code in a way that trips up the Desktop to establish the base URL as a authenticated datasource that can be refreshed in the Service.  What am I missing?

 

Thanks for the help in advance,

Woody

 

 

5 Replies