Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi
In the below mentioned code snippet, the number of retries is 5 in case of 500 response code of the HTTP call.
https://learn.microsoft.com/en-us/power-query/wait-retry
let
waitForResult = Value.WaitFor(
(iteration) =>
let
result = Web.Contents(url, [ManualStatusHandling = {500}, IsRetry = iteration > 0]),
status = Value.Metadata(result)[Response.Status],
actualResult = if status = 500 then null else result
in
actualResult,
(iteration) => #duration(0, 0, 0, Number.Power(2, iteration)),
5)
in
if waitForResult = null then
error "Value.WaitFor() Failed after multiple retry attempts"
else
waitForResult
Can someone please tell me what is the default number of retries if no count is specified.
hi,
The default number of retries for the Value.WaitFor function in Power Query M is 3.
In your code snippet, you have explicitly specified the number of retries as 5 using the parameter (iteration) => 5, which means the function will attempt the operation a maximum of 5 times before throwing an error if it encounters a 500 response code.
If you don't specify the number of retries, the function will default to 3 retries.
accept this reply as solution if this resolved your doubt.
If this helped, Follow this blog for more insightful information about data analytics
https://analyticpulse.blogspot.com/
Please Subscribe AnalyticPulse on YouTube for future updates:
https://www.youtube.com/@AnalyticPulse
Please subscribe CogniJourney On Youtube For Daily fun facts:
https://www.youtube.com/@CogniJourney