Recently a SharePoint student asked about creating columns for a list and then reusing them in another list or library. This can be solved in a couple of ways. Using the Browser in SharePoint 2010, you can either create these columns as list columns and save that list or library as a template and then use it to create a new list or library, or you can create them as site columns in which they will be available to any list on any site in the Site Collection. You can also create them as Managed MetaData columns so that they are available to any Web Application that subscribes to that Service Application even across Farms!
For this blog we'll create them as Site Columns.
We will create 2 'choice' columns; Flavor and Scoops as Site Columns at the top level site of our site collection. We will then use these columns in 2 lists.
When we are done, the advantages of creating each column once and then re using it should be apparent.
Starting at the Top Level Site of a Site Collection I choose Site Actions>Site Settings
Next I Click on Site columns under Galleries.
This takes me to the Gallery of all the Available Site Columns for this Site Collection. Although there are many available Site Columns, there isn't one for Flavor or Scoops so I'll create them here. I click the Create Link.
Here I fill in the Site Column form with the values as shown.
Other than the values indicated, I leave everything else with the defaults.
I'm then taken back to the Site Columns Gallery where I click Create again.
I fill out the form as shown.
I leave the default values other than what is shown and click O.K.
Verify the Existence of the new Site Columns by looking under the Custom Columns group.
Now I can use these for any list or library in this Site Collection.
I click on the Site Actions> More Options to Create a new custom list called Ice Cream Cones.
Since I have SilverLight installed, I get a cool Silverlight Control to pick my Template. I'm using custom so I click on Blank and Custom to filter the options.
Click on Blank & Custom to filter the options then choose Custom List. I'll fill in the Name with IceCreamCones then click Create.
Now I'll add my Site Columns to the List By clicking on List Settings in the Ribbon.
In the Columns Section I'll click Add from existing site columns.
I'll filter the choices by choosing Custom Columns from the Select site columns from: drop down list and then I'll click Add twice to add my Site columns.
After moving Flavor and Scoops to the Colunns to add side I click O.K.
I'll go ahead and leave add to default view checked.
Optionally, I'm going to change the name of the Title column to something meaningful in this context – Name, by clicking on the Title link in the Columns section.
I'm going to add a few items to this list by clicking on the iceCreamCones link in the quick launch bar.
I can always go into title description and icons in the list settings area to add spaces to the name of the list later.
I'll add a few items by clicking Add new item and filling out the new item form.
I add items by filling out the form. Here is the first one the Bigfoot – 3 Scoops of Chocolate!
When I'm done I click on Save.
As you can see, adding the Site Columns feels just like adding a regular list column to a user but it's much more flexible and will be used when creating content types.
Now I'll create a recipes list for our employees and use the site columns created earlier in this list as well. First I click Site Actions > More Options.
Again, I'll click Blank & Custom to filter the options and then choose Custom List and name it Recipes, then click Create.
I'll Click on the List Settings icon in the Ribbon.
I'm going to create a list column called, cone type which will be choice by clicking Create Column.
This creates a List Column whose scope is this list and any list created from this list if used as a template. The difference is that a Site Column is available to any list or library in the Site Collection.
I'll fill out the form as shown leaving the defaults for the rest of the values and click OK.
Now I'll add my Site Columns by clicking on Add from existing site columns.
I'll filter by Custom Columns in the Select site columns from: drop down list and then click Add to move Flavor and Scoops over to the Columns to add side and click OK.
I'm going to change the Title Column to ProductNumber by clicking on the Title link under Columns.
I fill out ProductNumber is the Column name text box and click OK.
I'm going to create a Name Column which will be a lookup to the iceCreamCones list by clicking on Create Column.
I fill out the form as shown.
I'll ignore the Enforce relationship behavior for this blog post.
I'll click on the Recipes link in the Quick Launch Bar in order to get to the All items page of the Recipes list so that I can add some items.
I'll click Add new item to add a new item.
That's it. We created 2 Site Columns, and then created 2 custom lists and added them to these lists. We can reuse these on any list or library in our Site Collection. This example is a great candidate to show the Enforce relationship behavior functionality available in SharePoint 2010 but we'll save that for another blog.