Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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