SharePoint lists are tables of data, much like Excel spreadsheets. In Chapter 2, I showed you how to create lists from spreadsheets. But lists can do a lot more than just store columns and rows of data—in fact, lists are like mini-applications in SharePoint.
I’ve organized this chapter to follow the steps I use when creating new list-based applications for my clients:
Create a list using one of the built-in templates.
Add columns to collect additional data and calculate values as required.
Create supporting lists for lookups and master lists.
Add views to display required reports.
Enable email, versioning, and item approval as required.
Optionally customize the data entry forms.
Save the final list as a template and deploy it to other site collections.
That’s similar to the process I showed for creating sites: start with what’s provided, customize, get approval, and deploy. Don’t skimp on the approval part of that process—it’s a lot harder to change lists once they are deployed. Get agreement that the prototype you’ve created meets the stated needs before you save it as a template and deploy it across multiple sites.
SharePoint provides a set of built-in list templates that you can start from and customize as needed. Tables 4-1 and 4-2 describe the list templates that come with SharePoint.
Table 4-1. Built-in list templates
Category
List
Use to
Communications
Announcements
Share news, status, and other time-sensitive information.
Contacts
Collect and store phone numbers, email addresses, and other information about employees or external contacts. Contact lists can be shared with Outlook.
Discussion Board
Create threaded discussions among team members. Discussion boards are similar to newsgroups.
Custom Lists
Custom List
Create a new list starting with basic columns and a standard view.
Custom List in Datasheet view
Create a new list starting with basic columns and a datasheet view.
Import Spreadsheet
Create a new list with columns and data from a spreadsheet. Includes a datasheet view.
Tracking
Links
List web pages and other resources related to a task or project.
Calendar
Track events, milestones, and deadlines that can be displayed graphically as a calendar page. Calendar lists can be shared with Outlook.
Tasks
Track work items.
Project Tasks
Track work items that can be displayed graphically in a Gantt Chart.
Issue Tracking
Assign issues or problems to individuals and then track the progress of the resolution.
Survey
Poll individuals using a series of questions and display the results graphically.
Table 4-2. Additional list templates provided by MOSS
Category
List
Use to
Custom Lists
Languages and Translators
Add languages and translators used by the Translation Management workflow.
KPI List
Track and display progress toward a set of goals graphically.
As with site templates, it’s a good idea to create one sample of each type of list in a gallery that site owners can browse. Then, as you create new custom lists, you can add them to the gallery. It really helps users to see the available list types before creating their own.
When you create a new site, some lists are created automatically by the site template. Figure 4-1 shows a site created from the Team Site template, which automatically includes Announcements, Calendar, Links, Tasks, and Discussion lists. See Chapter 3 for tables of what lists and libraries each site template includes.
These new lists are empty to start with: list templates define the columns that the list will contain and the views of the list items that are displayed. The list items are provided by the users. Figure 4-2 shows the parts of a Links list.
Figure 4-1. Site templates automatically create some lists
Figure 4-2. The parts of a list
Items
Items are the rows of data in a list. Users add new items or change existing ones.
Columns
Columns define the types of data that a list contains. The Links list contains columns for a URL and Notes as well as a set of predefined columns that SharePoint uses such as ID, Created, Created By, and so on. Those predefined columns are usually not displayed. Columns are also called fields in the Microsoft documentation.
Views
control what columns are displayed, how they appear, and what filters or grouping are applied to the rows. Views are similar to reports.
The built-in list templates give you most of what you need, but you’ll quickly find that you have to make some changes to get what you want. I gave a quick example of how to create and customize a list in the Phone List example in Chapter 1, so I won’t repeat that information here, but I will go into more detail about the types of changes you can make and why you make them:
Add columns to gather additional information.
Add calculated columns to display information in different ways.
Add choice or look-up columns to provide new ways to group or filter items.
The following sections describe those tasks in detail.
Adding Columns to Gather Information
You can extend any list by adding new columns to it. Let’s look at the Phone List sample again to show how that works. To add an Assistant column to the Phone List:
On the list toolbar, click Settings -> Create Column. SharePoint displays the Create Column page.
Complete the page as shown in Figure 4-3 and click OK. SharePoint adds a new text column to the list.
Figure 4-3. Adding an Assistant column to the Phone List
Once you add an Assistant column, it’s up to you to add data for each row in the list. Because you selected Add to default view in Figure 4-3, Assistant automatically shows up in the main view of the list, so you can just click Actions -> Edit in Datasheet to fill in the new column. But don’t do that yet! I’ll change and expand this example shortly.
Assistant is a simple text column. Figure 4-3 lists the special uses for some of the other column types. Most of them are obvious, but I’ll explain the Calculated and Lookup columns in detail in the following sections.
Adding Calculated Columns
Use calculated columns to bring together values from other columns. For example, the Phone List contains a Full Name column that is a single line of text. Since the list already has First Name and Last Name in it, it makes more sense to create Full Name out of those two columns. To do that:
On the Phone List toolbar, click Settings -> Create Column. SharePoint displays the Create Column page.
Complete the page as shown in Figure 4-4 and click OK. The formula shown in Figure 4-4 is=[First Name] & " " & [Last Name]. SharePoint adds a new calculated FullName column to the list.
Figure 4-4.Adding a calculated column to a list
To get help using formulas, display the SharePoint Help and click “Formulas and functions.” To display SharePoint Help, use the following link: ./_layouts/help.aspx?Key=NavBarHelpHome.
Notice that I told you to name the column “FullName.” The Phone List already has a “Full Name” column, and you can’t have two columns with the same name! We’re not using the Full Name column, so let’s delete it. To delete a column:
On the list toolbar, click Settings -> List Settings. SharePoint displays the Customize page.
Scroll down and click Full Name in the Columns list. SharePoint displays the Change Column page.
Scroll to the end of the page and click Delete. SharePoint warns you that data for this column will be deleted. Click OK to delete the column.
Use the Choice, Lookup, and Yes/No column types to structure the information entered in the column. In Chapter 1, I added a Department Choice column to the Phone List. I used the Choice type because I wanted to make sure the entries were consistent—users can only choose from the selections in the list of departments I provided. That prevents misspelled or incorrect department names and allows the Phone List to be grouped by department.
Choice, Lookup, and Yes/No column types have these advantages:
Values are consistent, so grouping and filtering on these columns is effective.
It’s easier to enter values, since choices are provided as drop-down lists or multiple-choice selections.
Choices can be shared across lists and sites.
Let’s continue with the Phone List sample a bit more and change the Assistant column from a text column to a lookup. You can’t change the type of a column once it’s created, so we’ll have to delete the Assistant column and re-create it with the new type. (Remember, I told you not to enter data in it!) To change the Assistant column:
On the Phone list toolbar, click Settings -> List Settings. SharePoint displays the Customize page.
Scroll down and click Assistant in the Columns list. SharePoint displays the Change Column page.
Scroll to the end of the page and click Delete. SharePoint warns you that data for this column will be deleted. Click OK to delete the column.
On the Change Column page, click Create Column. SharePoint displays the Create Column page.
Complete the page as shown in Figure 4-5 and click OK to create the new Assistant column.
Figure 4-5. Creating a new Assistant column as a Lookup type
Now, you can fill out the Assistants in the phone list. To do that:
On the Phone list toolbar, click Actions -> Edit in Datasheet.
Click the Assistant column and then click the down arrow on the right side of the column to drop-down the list of choices.
Click the choice to select the assistant as shown in Figure 4-6.
Figure 4-6.Using the Lookup column
The Assistant column is a circular lookup. That is, you can choose any name provided that the person is already entered in the Phone List. You can use a lookup to pull data from another list in the site by selecting a different source list and column name.
Please check back next week for the continuation of this article.