How to ignore Source if particular web site not found

Negi1984

New member
Joined
Nov 15, 2018
Messages
2
Reaction score
0
Points
0
Excel Version(s)
office 365
Hi All,

I am using below giving function to extract resources information from multiple web pages. Now the issue is that sometimes if the resource left the organization than that particular web link will not work. Same issue I am facing right now, I want how to modify below function so that if that particular link not found it just ignore that link and look for new source link.

I tried myself but not much aware about M-Code so looking for expert suggestions.

HTML:
let GetResults=(URL) =>
let
   
    Source = Json.Document(Web.Contents("https://XX-XX.internal.XXXXXXXX.com/XX-XXXX/XX-XXXX/people/search/"& URL)),
   
 #"Path" = Source,
    if Path[HasError] then
in 
#"Path"
else
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"profileID", "chargedCC", "managerProfileID", "managerFullName"})
in
    #"Expanded Column1"
in GetResults
 
Back
Top