Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ChristopheB
New Member

Power Query check validity URL via Web.Contents fails

Hi,

I have a column [URL] with a list of urls. I want to add an extra column that checks whether the URL is valid or not. I know that certain urls return a 400 error, but I can't seem to get an error to point that out.

 

This is the code I use:

= Table.AddColumn(#"Waarde vervangen", "status", each if [URL] ="" then "" else try Web.Contents([URL],[ManualStatusHandling={400,404}]))

 

(I tried with and without the option 'ManualStatusHandling', but with the same result.)

 

Any ideas or other ways to check whether the URL still works?

1 REPLY 1
lbendlin
Super User
Super User

That's just half of the code.  You now need to actually implement the manualstatushandling.

BUT! You can only do that in custom connectors.

 

 Note

Extensions are able to use the ManualStatusHandling option with status codes 401 and 403, which is not something that can be done in Web.Contents calls made outside of a custom data connector (that is, directly from Power Query).

 

Handling status codes with Web.Contents for Power Query connectors - Power Query | Microsoft Learn

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors