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!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hi!
I have a table of GET API URLs in a query which I call with a Web.Contents in a separate function query.
My table query refreshes often crash due to one of the function calls returning a 502 bad gateway.
Is it possible to add some code to force my Web.Contents to retry if 502 BG is returned? Is this ill adviced? The refresh will typically work when I try to refresh it again, or crash on another URL
(URL) as table =>
let
Source = Json.Document(Web.Contents(URL)),
/* Somehow retry if Source returns 502 */
in
Source
Thanks!
Solved! Go to Solution.
Yes. There are a couple nice blog articles about that - for example Handling Unsuccessful HTTP Requests in Power Query M (tonymcgovern.com)
I am actually abusing try...otherwise... as a cheap way to have a second attempt at an API call if the first one fails (some APIs need "warm up calls"). Not generally recommended, but neat when it works.
Yes. There are a couple nice blog articles about that - for example Handling Unsuccessful HTTP Requests in Power Query M (tonymcgovern.com)
Thanks!
If it should help anyone in the future, try 'try'
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 19 | |
| 12 | |
| 9 | |
| 8 | |
| 8 |