Skip to content

Instantly share code, notes, and snippets.

@Hugoberry
Created March 2, 2017 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hugoberry/0f8f595d8eace5ee1effa34c2909f382 to your computer and use it in GitHub Desktop.
Save Hugoberry/0f8f595d8eace5ee1effa34c2909f382 to your computer and use it in GitHub Desktop.
When the trace files shows duplicate Web.Content which might be triggered by some operations down the Power Query pipeline, it is a good idea to Buffer the Web.Contents first
(url) =>
let
BufferedWithMetadata = (binary)=>(try Binary.Buffer() otherwise null) meta Value.Metadata(binary),
response = BufferWithMetadata(Web.Contents(url,[ManualStatusHandling={404}])),
out = if Value.Metadata(response)[Response.Status]=404
then null
else response
in
out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment