Forum Discussion
Filtering by whether Image Exists or Not
- 6 years ago
Hi Revokez ,
We can add a custom in power query editor to identify if this url is valid:
let ContentType = Binary.InferContentType(Web.Contents([Address]))[Content.Type], t = Table.RemoveRowsWithErrors(#table({"Type"} ,{{if Text.Contains(ContentType,"image") then 1 else null}} )), RemoveNull = Table.SelectRows(t,each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null}))) in not Table.IsEmpty(RemoveNull)Then you can use it in any filter you want.
If you are using the local file address, try to use the File.Content instead of Web.Content
Best regards,
Hi Revokez ,
We can add a custom in power query editor to identify if this url is valid:
let
ContentType = Binary.InferContentType(Web.Contents([Address]))[Content.Type],
t = Table.RemoveRowsWithErrors(#table({"Type"} ,{{if Text.Contains(ContentType,"image") then 1 else null}} )),
RemoveNull = Table.SelectRows(t,each not List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null})))
in
not Table.IsEmpty(RemoveNull)
Then you can use it in any filter you want.
If you are using the local file address, try to use the File.Content instead of Web.Content
Best regards,
Thank you for providing a solution for this issue. I have successfully added the column, but all of my URLs evaluate as false. Whether the image exists or not.
An image that should be false,
An image that should be true,
https://interfaceinc.scene7.com/is/image/InterfaceInc/1151006999G15S001_cubic_area_va1?$160x160$
Can you help me figure out what might be wrong with my code. I used your exact code. Why isn't it working?
Thanks in advance!