Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.