Forum Discussion
Image Column in List
- May 20, 2022
Hello Mattw112
you can use an column formatting on the picture column so you can show your picture instead of the url.
Try this:
{"elmType": "a","attributes": {"href": "@currentField","target": "_blank"},"children": [{"elmType": "img","style": {"width": "150px"},"attributes": {"src": "@currentField"}}]}Regards, Dave
Hello Mattw112
you can use an column formatting on the picture column so you can show your picture instead of the url.
Try this:
Do you know if this only works for internal img URLs?
I am trying to grab the src URL from [$BannerImageUrl] but this only works for relative links (/_layouts/15/images/...) but not for HTTPS links.
As I am using MS stock images for my thumbails, most values in the ImageBannerURL property refer to e.g. "https://cdn.hubblecontent.osi.office.net/m365content/publish/...."
For these entries, I only get the broken image icon
- ganeshsanapNov 29, 2023MVP
If you are using external images, those might not work with SharePoint JSON formatting.
Follow this article to fix the issue of external images with SharePoint JSON formatting: SharePoint Online: External Image URLs not working in JSON Formatting
Please consider giving a Like if my post helped you in any way.
- SvenSHNov 29, 2023Copper Contributor
this actually did the trick! At least until I integrated that page view with the "document" web part to one of my sites. After saving, all pictures are broken again (even the ones with the relative link).
Guess it's back to hero tiles and manually editing each link and picture again..