Creating Custom Lists in SharePoint 2007

Custom Lists are one of the most commonly used items in both SharePoint Server 2007 and the previous version. This popularity stems from the fact that custom lists have the same function in SharePoint as a table in a database—not just a place to store information, but also an entity that maps to a business need.

For example, suppose you need to store some data in SharePoint but you don't want to spend time creating UI Forms for data entry and updates, in other words, you want SharePoint to streamline the data management. This scenario is one possible use case for a custom list.

Lists strongly resemble database tables: Tables have columns and rows; similarly lists have columns to which you add items, forming rows. The simplicity of creating custom data storage provides huge benefits, because SharePoint can automatically provide a standard UI to manipulate the stored data, including the ability to add, update, and delete items. Moreover, SharePoint provides solid management features that let you set various list options as required. For example, you can apply built-in workflows to the items, or create your own workflows. You can also create "Event Receivers," essentially hooks to data actions that let you execute code whenever certain events occur. Table 1 shows a blank custom list. (Yes, it looks just like a table!)

Table 1. Custom List: As you can see, a blank custom list can have an arbitrary number of columns and rows.


Column 1 Column 2 Column 3    ..... Column n
Item 1
Item 2
Item 3
....
Item n

Despite the many similarities between custom lists and database tables, there are also many noticeable differences. For example, custom lists do not provide support for transactions, so you can't roll back changes made to the data. Managing very large lists or including columns containing large data values within lists also presents performance challenges. You need some careful planning to get reasonable performance in large-scale lists. For example, when lists are likely to contain more than 2000 items, you need to consider such options as creating views (for data presentation) and subfolders (for data categorization). An excellent white paper on Microsoft TechNet explains the challenges of working with large scale lists, and provides workarounds for some of the problems.

Custom List Creation Options

SharePoint provides three ways to create custom lists as listed below:
  • From scratch or from an existing list template using the SharePoint UI
  • Via SharePoint Features
  • Through the SharePoint API
The first method is the easiest, and the subsequent methods are each progressively more powerful. This article explores the first method: creating custom lists from scratch or from an existing list template using the SharePoint UI.
The difference between creating a custom list from scratch and creating one using an existing list template is that in to create a list from scratch, you use a list schema (with a possibility that the schema points to existing data). As an example, consider a SQL table-creation script. You can reuse that script multiple times to create a table. Custom lists are similar—you might want to create the same list multiple times in different SharePoint sites.

Procedure to Create a Custom List

The following procedure explains how to create a custom list, add a custom column to it and then add some data.
  1. Open the browser and type the following URL in the browser:
  2. http://SITE-COLLECTION-URL/_layouts/create.aspx
    
    Replace the SITE-COLLECTION-URL portion of the preceding URL, with the actual URL of the site collection where you want to create the list. Alternatively, from the default page, go to Site Actions View All Site Content, and then click the Create button.
Author's Note: Knowing the URLs for commonly-used tasks (such as creating custom lists) saves time and acts as a shortcut.

2. From the Create Page , locate the "Custom Lists" section , and then click the first item, "Custom List"
(See Figure 1)
Figure 1:  Creating a Custom List: Select the "Custom List" item from the Create options

















 3. You'll see a "New" page (see Figure 2). Enter Sample List in the "Name" field , and type Sample Custom List in the "Description" field. Leave the Navigation option set to the default "Yes" value.

Figure 2: New Custom List Page:  Fill out a name and description for the new list, and then click the Create button.
 4. Click the Create button to create the list. You'll see a new blank list titled with the text you entered in step 3 (see Figure 3).

Figure 3: New List - Here's the new "Sample List" custom list, before adding any columns or items.
 Author's Note: SharePoint adds the "Title" column you can see in Figure 3 by default. While you can remove it, it's not recommended.

5. From the Settings menu, select "Create Column" (see Figure 4).
Figure 4: Creating Columns. To create a new column, select the Create Column option from the Settings menu.
 6. In the Column Name field, type NickName. In the list of radio box options, select "Single line of text" (see Figure 5).
Figure 5. Column Properties: On this screen, provide a name for the new column and select the type of data it will hold.
 7. Leave all other field values set to the defaults (see Figure 6), and click OK to add the column to your custom list.

Figure 6. Advanced Column Settings: Feel free to enter a description, but for this example, accept the default values for all other column settings.
 8. You will now see the list with your new column added, as shown in Figure 7.

Figure 7. Custom List with New Column: The figure shows the NickName column added to the custom list.

 Now you can add some data. In SharePoint, rows are "items," so click New → New Item (see Figure 8).

Figure 8. Adding Items: Select New Item from the New menu to add a new item.






Enter some text for the Title and NickName fields (see Figure 9).

Figure 9. Populating New Items: SharePoint automatically provides an appropriate control type for each field.
 Click "OK", to save the item. It will appear in the list, as shown in Figure 10.
Figure 10. New Item: After you save the new item, it appears in the custom list.