Forum Discussion
Custom Thumbnail Images on Tile/Gallery View - Sharepoint Online
Hey all,
I have a Sharepoint list/library of images in various file types (png, jpeg, tif, etc.). Most of these images have a thumbnail autogenerated by Sharepoint which is great. There are some however, that do not and I have subsequently uploaded a custom image to be used in the thumbnail column.
When I am in the Tiles view, the thumbnails that Sharepoint autogenerates shows up, but the custom thumbnails don't and still show as the default no image view. I think part of the issue is that in the View Format tab and Document Card Designer, the autogenerated thumbnails are considered "Show the File/Folder Thumbnail" and the custom thumbnails show up under the "Thumbnail" column. Is there a way to update the JSON so that if there is an autogenerated thumbnail it shows, and if there's a custom thumbnail to use that?
Thanks!
- TimLBSteel ContributorTry reversing the logic you would normally use for custom JSON formatting. Assuming the custom thumbnail field is a string/URL use the index of function to test the length of the value in that field.
(have a look at this article for guidance)
https://knowledge-junction.in/2021/08/24/sharepoint-list-view-formatting-how-to-find-length-of-string/
If the length indicates that the field is not filled out, then assume the regular thumbnail is there and display. Otherwise show the custom thumbnail field as the image.