Create Picture Type Site Column using CSOM

Create Picture Type Site Column using CSOM programmatically in SharePoint

Create Picture Type Site Column using CSOM. In this post, I describe you to Create Picture Type Site Column using CSOM. If you need to create a picture field, you have to set the field type to URL. An additional attribute Format will indicate that you want to create a picture field. If you need to create choice type site column follow my post-Create Choice Type Site Column using CSOM.

[AdSense-A]

 ClientContext clientContext = new ClientContext(SiteUrls);
                Web rootWeb = clientContext.Site.RootWeb;
string schemaPictureField = "<Field ID='<GUID>' Type='URL' Name='EmployeePicture' StaticName='EmployeePicture' 
   DisplayName='Employee Picture' Format='Image'/>";
rootWeb.Fields.AddFieldAsXml(schemaTaxonomyField , true, AddFieldOptions.AddFieldInternalNameHint);
clientContext.ExecuteQuery();

 


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Content is protected !!