pnp / List-Formatting

List Formatting Samples for use in SharePoint and Microsoft Lists
https://pnp.github.io/List-Formatting/
MIT License
1.7k stars 823 forks source link

JSON Formatting Image Column SharePoint Lists #765

Closed luanoprzybilski closed 5 months ago

luanoprzybilski commented 5 months ago

New Images from image columns in SharePoint Lists are now stored under Site Settings > Storage Metrics > Lists > LISTNAME > Attachments > ItemID. How can I refer to the image in a JSON formatting? "src": "[$COLLUMNAME.serverRelativeUrl]" no longer works.

Images from image columns are no longer stored under Websiteobjects > Lists > LISTID, I learned from Microsoft Support

tecchan1107 commented 5 months ago

Hi @luanoprzybilski . Unfortunately, it does not appear to be possible to retrieve the serverRelativeUrl of an image stored in Attachments at this time. I have contacted Microsoft about this issue in the following issue. Let's wait for an answer. https://github.com/SharePoint/sp-dev-docs/issues/9411

*The fileName can be obtained even for images stored in Attachments. Therefore, the path to the image can be obtained by writing the following.

@currentWeb+'/Lists/**YOUR-LIST-NAME**/Attachments/'+[$ID]+'/'+[$COLLUMNAME.fileName]
tmax-siva commented 5 months ago

you can find the solution for this issue here

https://learn.microsoft.com/en-us/answers/questions/1463565/sharepoint-online-list-image-column-is-not-returni

tecchan1107 commented 5 months ago

Thanks for letting me know!

However, I consider it a bug if it doesn't work as per the written documentation, no matter where it is stored. Also, disabling attachments is very risky because it will delete all attachments. image

I would like to consolidate this topic in the following issue, so I will close this issue. https://github.com/SharePoint/sp-dev-docs/issues/9411