SOLVED

Hyperlink/Picture Column suddenly breaks external images in Gallery/Card Designer

Copper Contributor

We use a Flow with an API connection to grab image links from an external vendor and populate that data to the Hyperlink or Picture column of a SharePoint list. We then add JSON formatting to display the image links in a Gallery view. The Hyperlink or Picture Column is set to display as Picture.

 

The external images still display fine in the list item view, just not the Gallery/Card view. This was working fine for several months, but something seems to have changed over the last weekend, causing externally linked images in Picture/Hyperlink Columns to break. 

 

I setup a simple test list to display this behavior using a public domain image.

 

External Image link:

https://www.publicdomainpictures.net/pictures/20000/velka/computer-memory-chips.jpg

 

Internal Image link:

https://[mydomain].sharepoint.com/sites/WebDev/SiteAssets/Lists/[LIST-ID/computer-memory-chips.jpg

 

Here is an All Items List View sample:

AndrewStitt_0-1683835555553.png

Here is a Gallery/Card Designer View sample of the same list:

AndrewStitt_1-1683835877450.png

No JSON used in these examples, just the default Gallery / Card Designer:

AndrewStitt_2-1683836009230.png

I've experimented with the Image column, which doesn't seem to exhibit this issue, but unfortunately that column is not available in the Create Items step of the Flow so I assume it cannot be dynamically populated.

2 Replies
best response confirmed by Andrew Stitt (Copper Contributor)
Solution

@Andrew Stitt Microsoft updated something in backend which affects external images referred in SharePoint JSON formatting.

 

When you refer external images in JSON formatting, src in img element is changed to data-untrusted-src automatically, like: 

ganeshsanap_0-1683879115751.pngYou can fix this issue by adding external site domain from which you are using images in HTML Field Security settings, detailed steps given at: SharePoint Online: External Image URLs not working in JSON Formatting 

 

I just tested this and it worked for me: 

ganeshsanap_0-1683879325510.pngAlso, it is possible to add/update SharePoint image columns using Power automate: 

  1. Add an image to SharePoint Image columns using Power Automate 
  2. Update image in SharePoint/Microsoft Lists Image columns using Power Automate 

Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

@ganeshsanap The backend change was indeed the cause. I added our vendor's domain to the list of "Allow iframes from this domain" in the HTML Field Security settings and that resolved the issue.

Thanks for your assistance and the tip on updating the Image column with Power Automate!
1 best response

Accepted Solutions
best response confirmed by Andrew Stitt (Copper Contributor)
Solution

@Andrew Stitt Microsoft updated something in backend which affects external images referred in SharePoint JSON formatting.

 

When you refer external images in JSON formatting, src in img element is changed to data-untrusted-src automatically, like: 

ganeshsanap_0-1683879115751.pngYou can fix this issue by adding external site domain from which you are using images in HTML Field Security settings, detailed steps given at: SharePoint Online: External Image URLs not working in JSON Formatting 

 

I just tested this and it worked for me: 

ganeshsanap_0-1683879325510.pngAlso, it is possible to add/update SharePoint image columns using Power automate: 

  1. Add an image to SharePoint Image columns using Power Automate 
  2. Update image in SharePoint/Microsoft Lists Image columns using Power Automate 

Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

View solution in original post