Field class

Represents a field in a list on a Microsoft SharePoint Foundation Web site.


Namespace:  Microsoft.SharePoint.Client
Assembly:  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

public class Field : ClientObject

A field is an element of a list or content type schema that specifies a property that is tracked for a list item. A field has an Internal Name, which specifies an identifier for the field. A field internal name is unique among other fields within a list and cannot contain spaces. A field has an Id, which is a GUID.A field has a specified field type. A field also contains state information for settings and additional metadata specified by the field type.

This code example gets a specified field, creates a description for the field, and displays the field title and new description.

using System;
using Microsoft.SharePoint.Client;

namespace Microsoft.SDK.SharePointFoundation.Samples
    class FieldExample
        static void Main()
            string siteUrl = "http://MyServer/sites/MySiteCollection";

            ClientContext clientContext = new ClientContext(siteUrl);
            Web site = clientContext.Web;
            List taskList = site.Lists.GetByTitle("Tasks");

            FieldCollection collField = taskList.Fields;
            Field oneField = collField.GetByInternalNameOrTitle("Title");
            oneField.Description = "MyNewFieldDescription";

            string fieldInfo = "Field Title: " + oneField.Title + "\n" + 
               "Description: " + oneField.Description + "\n";



Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.