Forum Discussion
jsteinigen
6 years agoFrequent Visitor
Web.Contents failed to get contents | (429): Data API call already in progress
Hello there! I've got a quite complex report that gets a good set of different fields. When I run a refresh on Power BI Desktop, it takes a while but works. After publishing to the service, refr...
jsteinigen
6 years agoFrequent Visitor
Well v-lid-msft, that'll be happening in parallel.
For now I had a closer look at the Web.Contents ManualStatusHandling option and think it should work to implement the wait-retry pattern for the 429 error. But saying that, I implemented it and get an error I cannot figure out.
I followed https://docs.microsoft.com/en-us/power-query/waitretry#putting-it-all-together but now getting the error message:
"Expression.Error: The import Value.WaitFor matches no exports. Did you miss a module reference?".
My code for the query:
let
Source = Csv.Document(
let
waitForResult = Value.WaitFor((iteration) =>
let
result = Web.Contents("https://au...censored...com",[RelativePath="/api/v1/surveys/selfserve/...censored.../data?fields=uuid,age,gender,...censored...",
Headers=[#"x-apikey"="...censored..."],ManualStatusHandling={429}]),
buffered = Binary.Buffer(result),
status = Value.Metadata(result)[Response.Status],
actualResult = if status = 429 then null else buffered
in
actualResult,
(iteration) => #duration(0,0,0,Number.Power(2, iteration)), 5)
in
waitForResult,
[Delimiter=" ", Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true])
in
#"Promoted Headers"
Any idea what I might be doing wrong and how to fix it?
jason435
Helper II
6 years agoI am getting the same error, did you figure this out?