1

I have a SharePoint list that contains image URLs, the type is "Multiple lines of text" They asked me to show the URL as an image and I followed the solution here: In a Sharepoint List: Display an Image (field type "Hyperlink or Picture")

I mean it worked, but only if you're inside edit grid view. outside grid view:

outside edit grid view

with edit grid view:

inside edit grid view

I have tried changing the type, making a new column with hyperlink or image as the type, activating rich text and various JSON/advice that is available here.

(i'm just an intern, I don't really know this)

5
  • Are you using external URLs for images or you want to upload images from local computer for new list items? Commented May 11, 2023 at 6:45
  • I am using External URLs for images sir @GaneshSanap (it came from an excel file, if that helps) Commented May 12, 2023 at 1:06
  • Can you include current JSON you are using and few examples of image URLs in your question? I will do some tests from my end and provide you working JSON Commented May 12, 2023 at 4:46
  • '{ "$schema": "developer.microsoft.com/json-schemas/sp/v2/…", "elmType": "a", "attributes": { "href": "@currentField", "target": "_blank" }, "children": [ { "elmType": "img", "style": { "width": "500px", "height": "250px" }, "attributes": { "src": "@currentField" } } ] }' Commented May 15, 2023 at 0:35
  • sorry I couldn't reply immediately, but heres the json I am using. I just copy and pasted from link I dont know if I can provide a link to the companies photos though, im sorry Commented May 15, 2023 at 0:38

1 Answer 1

0

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:

enter image description here

You 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:

enter image description here

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

1
  • 1
    THIS WORKED! thank you so much sir Commented May 15, 2023 at 0:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.