Working with Columns


It’s time to look deeper into what columns are and how you can effectively use them to define and organize information within your SharePoint sites. By carefully planning the various components of your site, you can build an environment that a user will successfully adopt. This section first discusses what a column is and then shows you how to create a column, which is also called a list-centric column, or a column that is attached to a single list. Like the lists and libraries discussed in the first three chapters of this book, columns have different types, and you’ll examine the various column types that you have available to you. Next, you learn what a site column is and then examine when to use a list-centric column versus when to use a site column.

What Is a Column?

A column is an element of information that describes an item on a SharePoint site. In some cases, the item may be an event, a company, or a task; in other cases, it may be a document, a web page, or a business form. In SharePoint, any content stored in a list or library is considered an item. No matter what the actual item is, columns provide a great way to further define and organize information beyond what is available via titles or folders.

Defining information effectively is a key reason you use SharePoint. Therefore, you may need to add new columns to define the various list and library items. For example, you can add a column to track document status to a document library so users can easily identify a document’s current state strictly by looking at its properties rather than making an assumption or asking the author directly. This is called a list-centric column, and you will learn to create one in the next Try It Out.

You may hear people describe columns as metadata or properties of an item. As described in Chapter 2, metadata is essentially information about information. In the case of a document, metadata is information that describes the document such as its status, owner, or due date. A single document might have multiple metadata values because quite often there are many things to describe about a document. When you design or change an information environment, you should understand what content is stored within the site and what people will need to know about it.

Try It Out-Create a Column

image from book

In this example, you create a column for a technical documentation library so business users can track the status of technology-related documents, such as user manuals and training presentations. Therefore, you need to create a team site and a document library called “Documentation” inside it. Because you do not want users to enter just any value for status, you provide a list of common choices. This example assumes you require a choice column that allows the selection of a document’s status, such as Alpha, Beta, or Final Release, in a document library.

  1. Select Settings on your Lists toolbar.

  2. Select Create Column from the drop-down menu, as shown in Figure 4-1. The Create Column window appears as shown in Figure 4-2.

    image from book
    Figure 4-1

    image from book
    Figure 4-2

  3. In the Column Name field, type Document Status.

  4. For the column type, select the Choice (Menu to Choose from) option.

  5. In the Description field, type This column contains the document status.

  6. For the Require That This Column Contains Information option, select Yes. This ensures that all documents are flagged with a status upon saving.

  7. In the Choices field, type on separate lines Alpha, Beta, and Final Release.

  8. In the Display Choices Using field, select Drop-Down Menu.

  9. Ensure that the Allow Fill in Choices option is set to the default of No because you do not want the user to create his own status labels.

  10. Remove the text from the Default Value field.

  11. You can leave Add to Default View selected.

  12. Click the OK button to save your changes.

How It Works

In steps 6 through 9, you create a choice column. A choice column, one of several column types, gives users a list of values from which to select in an intuitive manner, such as a set of radio buttons or a drop-down menu. The remaining column types are discussed in the next section.

image from book

Exploring Column Types

Chapter 2 discussed the different types of data that you can store in a column at a higher level. This section looks even deeper at the types of columns you can have in SharePoint, and discusses some of the various customization options that exist with them. In the “Create a Column” Try It Out you just completed, you selected a Choice column type to collect information from a drop-down menu, but you have other options at your disposal. At the end of this section, the “Change the Order of Columns on a List” Try It Out shows you how to reorder the columns of a list to make them more user-friendly.

Single Line of Text

Virtually every list starts with the Single Line of Text column type, possibly the most commonly used within SharePoint lists, as its primary or title column. When creating a Single Line of Text column, you have very few options for customization, as you can see from Figure 4-2 earlier in the chapter. However, you can select whether the column is required or optional. You can also limit the number of characters that a user can enter to prevent users from entering unnecessary data in a column. For example, this type of column limits users to entering ten digits for a phone number or five digits for a zip code. The final customization option is to specify a default value, which users can enter manually or which you can allow SharePoint to calculate.

Multiple Lines of Text

A Multiple Lines of Text column type has a variety of configuration options, shown in Figure 4-3. As with other columns, you can specify whether the column is required and enter a description that tells users what information to complete.

image from book
Figure 4-3

Because this column allows a variable amount of text, you can specify how many lines the field should display when users complete the information. You should give users plenty of space for situations where you expect them to enter a great deal of data; the size gives users a visual cue of how much information you want them to enter. For example, if the column is for a mailing address, three or four lines should be acceptable. However, if the column is for background information on a customer, you may want to provide at least 25.

The Multiple Lines of Text column has more advanced formatting options than most other columns, including the following:

  • Plain Text:   Most appropriate for scenarios where no special formatting is required, such as in the example of a mailing address.

  • Rich Text:   Users can format the text using the Rich Text Editor, shown in Figure 4-4, which is ideal when users input a larger amount of text that doesn’t have specially formatted elements, such as tables or pictures but may require some formatting and text alignment. You select this for notes and comments related to an item.

    image from book
    Figure 4-4

  • Enhanced Text:   Allows your users to add images, tables, and hyperlink elements to the column via the Advanced List Text Editor, as shown in Figure 4-5. This format is ideal for article body columns in an announcements list or employee biography content columns.

    image from book
    Figure 4-5

SharePoint 2007 has a new option called Append Changes to Existing Text. This feature keeps a running log of changes and additions to the list item and is great for situations where you need to track progress on a task or document changes. To use this feature, you must have versioning enabled on the list because each change is stored within a specific version of the item.

Tip 

For more information on versioning, see Chapter 3.

Choice

The Choice column allows a site manager to define a list of values from which a user can select, as shown in Figure 4-6. As with other columns, you can specify whether the column is required and enter a description that serves as an aid to users as they complete the information.

image from book
Figure 4-6

You enter all values by placing each value on a separate line. Users see this as a drop-down list, a set of radio buttons, or a series of check boxes. A drop-down list or set of radio buttons means users can only select one option, while check boxes allow them to select more than one item from the list of values. You can also specify whether users can fill in their own item if an appropriate value does not appear in the list, which is great if you want users to enter exceptional values. For example, you may have a survey list that collects information on preferences for the next company social. You may offer a set list of locations and then have an option that allows users to enter suggestions for a location.

As with the Single Line of Text, you can also include a default value from the list of choices or have the default value calculated. In cases where you are making a choice column a required field for a list, it’s best not to specify a default value because users may accidentally forget to specify the value and the default selected item is then saved. By not specifying a default value, you can enforce the selection of an item, which ensures the information entered into the list is accurate. For example, if you are required to give users a choice of whether information is confidential or public in a list or library, it would not be wise to set either choice as the default value because you would want the user to think about their selection and pick the right option.

Number

A Number column is pretty simple in customization options, as shown in Figure 4-7, but is extremely useful in many lists because it’s helpful for calculations or reporting.

image from book
Figure 4-7

You can make a Number column either required or optional. You may specify an allowed range of numbers that users can enter. For example, if you have a column to represent a user’s rating of an item, you can have a minimum value of 1 and a maximum of 10. You can also configure a column to display a specific number of decimal places or percentage value regardless of the format a person uses to enter the information. As with some of the previous examples, you may select a default or calculated value for your column.

Currency

A Currency column has the same customization options as the Number column type with one addition, as shown in Figure 4-8.

image from book
Figure 4-8

The Currency column enables a user to specify the regional format in which the data displays, such as $150,000.00 for the United States or £150,000.00 for the United Kingdom. There is no direct link between the regional setting and currency exchange rates.

Date and Time

You may need to add columns containing date and time information because many of the items you track in a list have some level of time relevance, such as a due date, start date, finish date, or completion date. In fact, every list has Date and Time columns for tracking when an item was created or last modified.

Beyond the options that determine whether this column is required and that add a description, you can have the column display as only a date or a time value. Time values are particularly useful if you intend to display your list information in a daily calendar view or if you define details on events, such as meetings or appointments.

You also have a few choices for displaying a default value - either no value, the current date, or a specific date, as shown in Figure 4-9. So, if you have a list where users submit requests, you can select Today’s Date as the default value for a column called “Request Date.” This reduces the amount of user entry and lets you accurately determine when a user submitted a request.

image from book
Figure 4-9

As with previously described columns, you can create a calculated value for a date column. This is useful if you are setting a value such as the default due date for an item. In that case, you may select the default value as [today] + 7, which sets the value to a week past the current date.

Lookup

A Lookup column is very similar to a Choice column because it supplies users with a set of predefined values for a column. The advantage is that you can point it to another list on the site and thus create more dynamic list values. This is better than storing all the values as a static property of the column because users update the list as part of normal business operations. For example, if you have a customer list, it’s unrealistic for a site manager to constantly log in and change a list column’s properties each time a company acquires a new customer. Instead you can have this column point to a centralized customer list that those closest to the business operations can maintain. The new customer name would then automatically appear as a value in the column as soon as the centralized customer list updates.

In addition to selecting the list and column that the Lookup column uses to display data, site managers can configure the column so that users can select multiple values for a list, as shown in Figure 4-10.

image from book
Figure 4-10

Yes/No

A Yes/No column type is essentially a check box column that defines whether an item meets a specific criteria item. For example, this type of column can designate whether an item displays on the main page of a SharePoint site, or whether an item is active. The primary configuration option when defining a Yes/No column is determining whether the default value should be selected or unselected.

Person or Group

The Person or Group column is ideal for assigning ownership of an item or personalizing the display of data to users of a list. Besides the usual determination of whether to make the column required or to add a description, you have the option of selecting multiple items, which allows you to assign a single task to multiple people. In fact, for a tasks list, the Assigned To column is based on the Person or Group column type.

You can also assign this column type to a group. For example, you can create a group called “Project Managers,” create a task list and assign it to all members of the Project Managers group. This is far more efficient than assigning a task to each member individually, especially if you had 800 members in this group. You have the added option of defining whether a person from this column is drawn from the list of all users or a SharePoint group, which is useful if you want to have an Assigned To column to represent who should review the document next. Because only those with approval rights should be reviewing items, it may make sense to specify that only members of the Approvers SharePoint site group be assigned to the column.

Your final customization option involves how the information displays. You can have the person identified by a variety of personal profile properties including display name, email address, and job title.

Hyperlink or Picture

This column offers very little from a customization perspective beyond specifying whether the item is required, but does offer one significant attribute. You can format the URL of the item as either a web address that users can click to open, or as a picture that displays as a thumbnail. See Figure 4-11 for an example.

image from book
Figure 4-11

Tip 

Other column types such as Audiences and Business Data are covered in greater detail in Chapters 9 and 12.

Try It Out-Change the Order of Columns on a List

image from book

When you create a list or library column, it is added to the list in the order in which it was created. The form fields reflect this order - an order which is not always the most logical flow for entering information. If, for example, you have the columns First Name and Email Address on your list and later want to also add a Last Name column, Last Name will show up as the last item on the form. A more logical scenario is displaying First Name, and then Last Name, and finally Email Address.

Because the order in which your columns display can make it easier for users to find and enter information into a list item, SharePoint offers an intuitive way to do it. The following example walks you through reordering the columns of a list to make the metadata more user-friendly. Although this example uses a list, you can apply the same methodology to reordering columns of a document library. You reorder the columns of the list so that the first and last names display at the top of the new item form versus being spread out, as shown in Figure 4-12.

image from book
Figure 4-12

Tip 

See Chapter 2 for more details on the differences between a form and a column.

  1. From your Lists toolbar, select Settings.

  2. Select List Settings from the drop-down menu.

  3. From the Columns section, select Column Ordering.

  4. By changing the drop-down selections, you can easily reorder columns into a more logical sequence as shown in Figure 4-13.

    image from book
    Figure 4-13

  5. When you are satisfied with your new order, click OK.

image from book

What Are Site Columns?

So far, all examples in this chapter have been limited to creating a column for a list or library. But you can associate the information for a single list with multiple lists. For example, for a column that defines customers, you commonly associate a customer’s name with items from multiple lists and libraries. Because the steps for creating a suitable customer list are somewhat time-consuming, it’s inefficient to reproduce the column on each list with which you want to associate client information. Instead, you can create what is known as a site column, which makes a column available to all sites and subsites. Generally speaking, if many lists will use your column at all levels of a corporate intranet or portal, you should create it at the top-level site of a site collection. This makes the site column available on all sites throughout the site collection.

A site column may be relevant only to a specific division or team. In that case, you may want to create the column only on the divisional site itself. It will still be available to all lists within that site and all sites below it; however, it will not be listed under the Available Site columns for the other subsites within the site collection.

Tip 

It’s important to consider where to place site columns in order to ensure that the organization gets optimal use of this shared feature. This is discussed later in Chapter 6.

The next two Try It Outs show you how to create a site column as well as how to add a site column to a list.

Try It Out-Create a Site Column

image from book

In the “Create a Column” Try It Out, you learned how to create a list-centric column. This Try It Out walks you through creating a site column within the central gallery of columns so that it can later be used by multiple lists with a site and its subsites. For this example, you create the site column so that it holds all the regions in which an organization has a presence. Because you want to ensure that your column is available to the maximum number of sites in your intranet, you create it at the very top level of your site collection.

  1. From the top level of your site collection, select Site Actions image from book Site Settings, as shown in Figure 4-14.

    image from book
    Figure 4-14

  2. From the Galleries section, select Site Columns. SharePoint presents you with a wide range of preexisting site columns, which are good starting points.

  3. Click Create from the toolbar. The Create Column window appears as previously shown in Figure 4-2.

  4. Give the site column a name. This example uses the name Corporate Regions.

  5. Select the Choice (menu to choose from) option as the type of information in this column.

  6. To better organize your site columns you can choose a group for your site column. You can create a custom group for your custom site columns. To do this select New Group, and type Classification Columns in the field provided.

  7. In Additional Column Settings, shown in Figure 4-15, type a description for the column type. For this example, type This is a list of regions our organization has offices in.

    image from book
    Figure 4-15

  8. Because regional association with content is required, select Yes for Require That This Column Contains Information.

  9. In the area under Type Each Choice On a Separate Line, type the various choices. For this example, enter United States, Canada, Europe and Asia-Pacific.

  10. Select Drop-Down Menu as the Display Choices Using option. This should be the default.

  11. Select No for Allow “Fill-In” Choices. This should be the default.

  12. Remove the text from the Default Value field.

  13. Click OK. You can now add your site column to all lists and libraries throughout your site collection.

How It Works

Now, when users add a list item, they are required to select a region from this list of choices. If you want to update the region choices available in your site column, you can return to the site column gallery to edit your column. In addition to the previous selection options, you also see a new check box that allows you to update all lists and libraries using this site column to include your changes.

So, you can update a large number of lists to accommodate a change in your organization from one single location. As you accumulate more and more lists and libraries, this valuable feature becomes more powerful and is a great timesaver.

image from book

Try It Out-Add a Site Column to a List

image from book

The previous example guided you though creating a new site column. You can now use this site column on any list or library on your site collection. This saves you the time and energy required to recreate list-centric columns. The following example guides you through the process of attaching a site column to a list or library. Instead of creating a column on the list from scratch, you add an existing site column to the list. The steps for doing so are considerably easier, and future updates to the column properties can be streamlined and rolled out to all lists from a single location. As you add site columns to a list, they become fields that users are required to fill out as they add list items.

  1. Select Settings image from book List Setting from your Tasks list toolbar.

  2. Select Add from Existing Site Columns from the Columns section.

  3. Select the Classification Columns group. As mentioned previously, site columns are organized by groups. Once you select a group, you see a list of site columns associated with that group.

  4. Select the site column you created earlier called Corporate Regions and select Add. You see the site column appear in the Columns to Add field of the screen, as shown in Figure 4-16. You can remove site columns by selecting the appropriate item in the Columns to Add area and clicking Remove.

    image from book
    Figure 4-16

  5. Make sure the Add to Default View option is selected and click OK.

How It Works

As you can see in Figure 4-17, the site column is now added to your list and users must select a region when they add an item. Most organizations like to enforce a standard set of required items that users must complete on lists and libraries, such as Owner or Status. Based on this methodology, an organization can create a site column for each type of information it wants to enforce and then reuse this column on all lists and libraries throughout the site collection. This greatly reduces the amount of maintenance.

image from book
Figure 4-17

image from book

When to Use a List-Centric Column versus a Site Column

Now that you can create list-centric columns and site columns, it’s important to understand when to use each one. Although it’s tempting to create a site column for everything and make it accessible to everyone, remember the following:

  • List-centric columns:   You use this column for specific column types or when you don’t want the column to appear in a column gallery. Some column types are only relevant for a specific list and only clutter the site column gallery for all other users and usage scenarios. For example, a software development team’s issue list may have a column that tracks whether a client called about an application bug or feature request and that column isn’t appropriate for any other list or site. Or, a column may contain important data that should not be shared with the entire organization, such as manually entered items or information from the business data catalog. In either of these cases, it’s more appropriate to create a column that is attached to a single list.

  • Site columns:   These are more appropriate for information that you want to associate with multiple lists. You also use a site column to ensure that there is consistency in how a column is configured. Because you create the column once and it’s placed in a central gallery for others to reuse, you save time and effort.

Tip 

Global elements, such as workflow templates and content types also use site columns. This is discussed in later chapters of this book.




Beginning SharePoint 2007. Building Team Solutions with MOSS 2007
Beginning SharePoint 2007: Building Team Solutions with MOSS 2007 (Programmer to Programmer)
ISBN: 0470124490
EAN: 2147483647
Year: 2007
Pages: 131

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net