SharePoint Pals
 | Sign In
How to Create a Site Column in SharePoint 2010
by Gopal Muthukrishnan 19 Feb 2013
SharePoint Developer, SharePoint Frontier
Today  :   5     Total  :    23708

This article describes how to create a site column in SharePoint 2010 by using SharePoint UI, Programmatically, PowerShell and SharePoint Designer. By this, you can choose your own choice to create a Site Column in your environment.

Site column

SharePoint 2010 has a site column entity that allows you to reuse columns across multiple lists.  If you create a new column in custom List, you can use the column in that list alone. Suppose if you create a site column you can use the column in any list or library within your Team Site

1. Create Site Column in SharePoint UI

2. Programmatically create Site column

3. Create Site Column by PowerShell

4. Create Site Column by SharePoint Designer

To create a new site column in a list or library

Step 1:-

Choose Site Actions


Step 2:-

Click Site Settings from Site Actions from Top Level Site


Step 3:-

Click the Site Columns from Galleries


Step 4:-

Click the Create link to create a new column.


Step 5:-

Enter the name for your site column in Column Name field.

Step 6:-

Select the column type by clicking the radio button.

Step 7:

Then Select Custom Column from Existing groups dropdown. This site column must be a member of this group.


Step 8:-

Click OK button. Your site column will be listed in site columns.

Programmatically create Site Column in SharePoint

Adding a New Site Column in SharePoint Site

                using (SPSite site = new SPSite(SPContext.Current.Site.Url))
                    SPWeb web = site.RootWeb;
                    //Create Site Column
                    string SiteColumnName = "India";
                    //Add choice Field "India"
                    if (!web.Fields.ContainsField(SiteColumnName))   
                        string countryField = web.Fields.Add(SiteColumnName, SPFieldType.Choice, false);
                        //Set the Field Properties
                        SPFieldChoice CityInIndia = (SPFieldChoice)web.Fields.GetField(SiteColumnName);
                        //Set the group for the Site column
                        CityInIndia.Group = "States";    
                        //Add the choices
                        string[] States = new string[] { "TamilNadu", "Kerala", "Andhra Pradesh", "karnataka"};
                        //Set the default value
                        CityInIndia.DefaultValue = "TamilNadu";
                        //Set Fillable value
                        CityInIndia.FillInChoice = true;
                        //Update the field

Create a New Site column by PowerShell

Code for creating a New site Column through PowerShell Script

 $site = Get-SPSite -Identity "http://sfs03-pc:12121/sites/Samples/"
 $web = $site.RootWeb 
 $fieldXML = '<Field Type="Text"
 Description="Employee Name Column Info."

Then check your Gallery you will find the site column in the name of EmpName under the group of EmployeeInformation

Modifying the Existing Site column by PowerShell

Code for Modifying the Existing site Column through PowerShell Script

$site = Get-SPSite -Identity "http://sfs03-pc:12121/sites/Samples/"
$web = $site.RootWeb 
$field.Type= "Choice"

Then check your Gallery, EmpName column type will change to Choice type

Create a new site column in Sharepoint Designer

Open your Site in Microsoft SharePoint Designer

Step 1:-

Click Site Columns


Step 2:-

Click the New Column from file Menu and the choose its Type


Step 3:-

Enter The Column Name in the TextBox and the Choose group


Step 4:-

Click save Button to find your Created SiteColumn


blog comments powered by Disqus

SharePoint Pals

SharePoint Pals, a community portal for SharePoint developers, Administrators and End Users. Let's join hands and share the point together.
Read this on mobile


Angular Js Training In Chennai
Advanced Angular Js training with real world developer scenarios
Angular Js, Web Api and Ionic for .Net Developers
All in one client side application development for .Net developers
Angular Js For SharePoint Developers
Get ready for the future. Its no more just C#

Get Connected

SharePoint Resources

SharePoint 2013 and 2010 Web Parts
Free Web Parts with Source Code for SharePoint Community

SharePoint 2013 Books and Tutorials
Collection of free SharePoint 2013 books and tutorials (eBooks, pdfs)

Supported By

Contribute your article and be eligible for a one month Free Subscription for Plural Sight. The Author of the most popular New Article (published in the previous month) will be awarded with a Free One month Plural Sight Subscription. Article can be sent to in a word document.

Related Resources

Recent Tweets

Twitter October 21, 21:34
How to Add a JS Link Reference to the Display Form or Any other ASPX Programmatically using CSOM PNP in SharePoint -

Twitter October 20, 13:01
How to Add a JS Link Reference to the NewForm and EditForm Programmatically using CSOM PNP in SharePoint Office 365-

Twitter October 12, 12:15
How to Deploy Provider Hosted Apps (Add-Ins) by App Stapling in SharePoint Office 365 -

Twitter October 11, 13:39
How to Deploy Provider HostedApp programmatically using CSOM in SharePoint Office 365 Activating Developer Feature -

Twitter October 10, 09:26
How to Use Angular HTTP Services in SharePoint List -

Follow us @SharePointPals
Note: For Customization and Configuration, CheckOutRecent Tweets Documentation