This happens when you create a New List and by default "Attachment" is turned on for the list.
Resolution:
Turn off "Attachement" for list items in Advanced Settings under list settings.
SharePoint online list image column is not returning the data properly
Hello, I trust you are doing well!
I have a matter to address regarding a project developed using the SPFX React framework. Lately, there have been issues with the SharePoint image column. When attempting to retrieve data from the image column using the PnP JS library, the response is not accurate.
I have included two samples for your reference: one from the affected list and another from the functional list.
The affected list response sample:
The functional list response sample:
The distinction is evident. From the functional response, I can easily obtain the server-relative URL and utilize it as needed.
However, observe the response from the affected list; it is decidedly peculiar.
Another peculiar behavior is that regardless of the file I attach in the image column, it is automatically renamed. It does not retain the same name within the image column.
When attempting to open the images directly in SharePoint, I've noticed that the URLs of the files exhibit a completely different syntax.
Affected list image URL sample:
Functional list image URL sample:
What could be the underlying cause of this problem? Please assist me by offering valuable suggestions to address this production issue.
Thank you in advance!
Happy coding...
Microsoft 365 and Office SharePoint Development
Microsoft 365 and Office SharePoint For business Windows
-
Debarun Banerjee 95 Reputation points
2024-01-21T13:22:01.0533333+00:00
3 additional answers
Sort by: Most helpful
-
Agarwal, Tanu 0 Reputation points
2024-01-02T07:27:40.3+00:00 is there any solution we found for this? We are also facing similar kind of issue in our projects and multiple SPFx webparts are stucked because of this issue.
-
Siva M 45 Reputation points
2024-01-29T12:06:22.9633333+00:00 if (RawImageTxt != "") { var ImgObj = JSON.parse(RawImageTxt); if(ImgObj.serverRelativeUrl==undefined){ var URLimg="siteurl/Lists/Quick%20Links/Attachments/"+item.ID+"/"+ImgObj.fileName }else{ URLimg=ImgObj.serverRelativeUrl } I've resolved the issue by doing this workaround.
-
Vanessa Braida 0 Reputation points
2024-10-25T10:56:37.3733333+00:00 Excuse me, but I'd need to keep the attachments in my list and I think that disabling them is only a work around:
The issue you portray was detected in February 2024, but we were able to use our list and flow till the 22nd of October 2024 without noticing any issue. The attachment column had always been there.
Is there any other explaination?Kind regards,
Vanessa