1

I am beginner for development apps for SharePoint and I am not sure that here is a right place to ask my question, so please accept my apologize for any convince. Although, I would like to upload thousands of images from my company's file server (or from my company's local drive) to my company's SharePoint list's image column. However, I read url of images (my company's file server) from a CSV file via CSV Helper(https://joshclose.github.io/CsvHelper/). I can create or update items (example: string, numbers, boolean, hyperlinks etc.) with Microsoft Graph (example: https://learn.microsoft.com/en-us/graph/api/listitem-create?view=graph-rest-1.0&tabs=csharp). Is there a way to upload images (url from csv file) to image column (type of field: image or hyperlink) of SharePoint's list? Note: I checked (Upload or replace the contents of a DriveItem : https://learn.microsoft.com/en-us/graph/api/driveitem-put-content?view=graph-rest-1.0&tabs=csharp) Thank you very much for both your time and your consideration. Happy New Year 2021! Regards

1 Answers1

1

The new Image column store a JSON like this:

"img": "{\"type\":\"thumbnail\",\"fileName\":\"v2-3a8922e13e7fbf30fa6db937b458f336_hd.jpg\",\"nativeFile\":{},\"fieldName\":\"img\",\"serverUrl\":\"https://contoso.sharepoint.com\",\"serverRelativeUrl\":\"/sites/dev/SiteAssets/Lists/538191ae-7802-43b5-90ec-c566b4c954b3/v2-3a8922e13e7fbf30fa6db937b458f336_hd.jpg\",\"id\":\"0247ce7a-04c7-4c16-81bd-29566877315a\"}"

We still need to upload images to SharePoint, so I suggest you use the hyperlink column, there is no obvious difference between the two columns.

Amos
  • 2,030
  • 1
  • 5
  • 9
  • Hi @Amos_MSFT, Thank you very much for your answer. It could be hard to handle Json string, however is it possible to use site asset image URL when I upload all images to site assets folder(Ref Link: https://stackoverflow.com/questions/56151967/post-image-into-list-sharepoint-with-microsoft-graph)? Otherwise I must use Hyperlink column. Kind Regards, Sezgin – Sezgin TABAK Jan 01 '21 at 09:00
  • Of course, you can upload the picture to the site assert. – Amos Jan 01 '21 at 09:06
  • Thank you very much again and I will try this option. I wish you health and great achievements in your career.Kind Regards – Sezgin TABAK Jan 01 '21 at 15:39