Forum Discussion
'Dynamic data source' error for Planned Refresh on semantic model
Thanks.
First I read the blog you linked. Then I asked ChatGPT to cut the URL and use Relativepath. The original URL query only asked for an API key and a table name, nothing more. So solving that seemed easy. However the query (still) works in Desktop, but trying Scheduled refresh gives me the same 'dynamic data source' error as before.
Cluesless now. If anyone has any more ideas, I'd be happy to try them out.
let
BaseURL = "https://api.onview.nl/api/",
APIKey = "10dc841a-...-83d1-6207f1dba36a",
RelativePath = "/dossier",
PageSize = 100,
MaxLimit = 10000,
PagesToFetch = List.Generate(
()=> [PageNumber=1, Offset=0],
each [Offset] < MaxLimit,
each [PageNumber=[PageNumber]+1, Offset=[Offset]+PageSize]
),
// Constructing the URL with relative path
ConstructedURL = BaseURL & APIKey & RelativePath,
// Fetching data
AllData = List.Transform(PagesToFetch, (page) =>
let
Response = Json.Document(
Web.Contents(
ConstructedURL &
"?offset=" & Text.From(page[Offset]) &
"&limit=" & Text.From(PageSize),
[Headers=[#"Content-Type"="application/json"]]
)
)
in
Response
),
You are still using a dynamic value for the first parameter of web.contents. You need to look at using the option properties of web.contents. Please see https://learn.microsoft.com/en-us/powerquery-m/web-contents and the above referenced article.
- Joris_NL2 years agoHelper III
I'm trying so hard but I'm getting nowhere.
On the 'web-contents' page of your link, I think example 3 applies. But the example doesn't have a field for the api key value... then how should this work? Makes me question this approach.
I asked ChatGPT to solve the issue but it keeps making the url in web.content a dynamic value instead of the base url.Despite those 2 problems I tried it myself. Didn't work so far.
AllData = List.Transform(PagesToFetch, (page) => let Response = Json.Document( Web.Contents( "https://api.onview.nl", [ApiKeyName = "/api", ApiKeyValue = "10dc841a-0745-...-6207f1dba36a", RelativePath = "/dossier"], "?offset=" & Text.From(page[Offset]) & "&limit=" & Text.From(PageSize), [Headers=[#"Content-Type"="application/json"]] ) )
Errors with too many arguments in this function (expecting 1 or 2). I tried different numbers of brackets or removing ApiKeyValue which doesn't even exist as a function(?) but getting nowhere.Any help would be appreciated!