Making Sense of the SharePoint World

Dec-132009

SharePoint 2010 - Everything Old is New Again

image "You Must Un-learn what You Have Learned!"

The public beta of SharePoint 2010 has been out for a few weeks now. Many people are discovering and blogging about some of the great new features you're going to find. Yet there have also been some significant changes to existing features. These are things you may have been using every day in SharePoint 2007 and WSS 3.0, but which in SharePoint 2010 have moved or changed in ways could cause confusion to experienced users.

In this article I'm going to focus on changes the typical end-user would see. In future articles I'll talk about changes for site owners and administrators.

If it Ain't Broke…

SharePoint 2007 took a lot of heat for having certain "quirks" in its user interface design. For 2010, much as they did for the Office clients in 2007, Microsoft put a lot of R&D into what it would take to make SharePoint easier for typical users. This resulted in a lot of changes.

Human beings are creatures of habit. With certain notable exceptions, we don't much like change. Despite having worked through a non-intuitive learning curve, or sometimes because of it, we would rather keep doing things the way we are used to than learn new ways - even if those ways are better.

...Fix it Anyway

Only time will tell if the changes Microsoft made truly are for the better, but they've definitely been made. Let's start by looking at the basic team site page in SharePoint 2010 side by side with its SharePoint 2007 equivalent:

image

image

At first glance, they're pretty similar. The WSS logo has been replaced with a "real" picture, but there's still a banner, title area, quick launch, and content space. But look a little closer. The Site Actions menu has moved. No big deal there - lots of custom master pages move that around. But, the new placement is comparable to the Backstage/File menu in the new Office 2010 client applications, thus making it a "natural" place for users to look for "application"(site)-wide functions. This analogy becomes even more obvious when some of the other tabbed interface options start showing up. (You'll see that later in the article.)

Where's MySite?

Another subtle change is the "personal" section of the banner. In SharePoint 2007, you had separate entries for User ID, links, and a direct link to your "My" site.

image

All of these options are now accessed through the menu under your name. There is also no reference to My "Site", rather it simply calls it your "Profile".

image

I think the hope here, is that by de-emphasizing the "independent site" aspect of the profile and personal storage, while actually expanding its function (the new profile features could fill up several articles on their own), resistance to deployment in certain enterprises would be reduced.

Bread-Crumbling Navigation

Getting around from site to site, and from place to place within a site, has received a LOT of attention in SharePoint 2010. In many cases, this has meant "reimagining" the concept of a breadcrumb.

In the case of 2007 site navigation, a breadcrumb stretched across the top of the page content area:

image

For large site hierarchies, this could become unwieldy as it stretched across the page. For 2010, Microsoft replaced it with a folder icon in the tab banner, which produces an indented hierarchical view of your current location:

image

Going the other direction, in SharePoint 2007 lists and libraries selecting a view was accomplished by selecting it from a drop-down list on the toolbar.

image

In SharePoint 2010, there is no list toolbar. While you can drill into the ribbon and find the view settings, then select your view, that's a lot of clicking. Fortunately, Microsoft has turned the title panel into an in-site breadcrumb. When looking at a list or library, the last item in that breadcrumb is the name of the current view. If you look carefully, you'll notice that there is a "down triangle" arrow. That's your hint that this element is actually a dropdown menu, where you'll find all of your view selecting goodness.

image

Tied up with a Ribbon

Of course, the rest of the stuff that used to live on a list or library's toolbar:

image 

has been moved into the Library tab of the new ribbon interface:

image

By the same token, individual items that lived in an individual item's dropdown:

image

have been moved into the Documents (or other appropriate item's) tab:

image

Note: In this case, the individual item dropdown is still there as well.

Summary

Some folks say, "The more things change, the more they stay the same". There have been a lot of changes in SharePoint 2010. While there are some things that have stayed the same, they are actually in the minority. In this article, I have gone over some of the many changes to "carry over" functionality you will find when moving from SharePoint 2007 to SharePoint 2010. There are many more than I could hope to address in a single posting. I hope, however, that this article has given you some ideas of where to look if you can't find your favorite function where it used to be.


Sep-202009

Indexing SharePoint List Columns

MCj03800210000[1]

Helping SharePoint Help You

A SharePoint system manages a huge amount of data. Amazingly, in a SharePoint content database, all of the data, for every list and library item, in every site and subsite, is stored in a single table. Looking at hundreds of sites, each with dozens of lists and libraries, each potentially containing hundreds or thousands of items, and you end up with one massive table!

Not So Limiting After All

Everybody has heard about the so-called "2000 item limit" in SharePoint. Remember that this isn't really a limit. SharePoint is quite capable of handling lists with tens, or even hundreds, of thousands of items. The issue is the "rendering" of those items, which starts becoming perceptibly slower if you have more than 2000 items in a single view.

While the indexing discussed in this article can have a minor effect on this rendering, it really is more general, and can improve list performance across the board.

Ask any DBA how to achieve maximum performance on a huge table, while other options may also come up, at a minimum you'll always hear the word "indexing". And make no mistake - SharePoint (whether Windows SharePoint Services 3.0, or Office SharePoint Server 2007) does do a lot of indexing. But that is only dealing with the user data table as a whole.

Once SharePoint has figured out which site and list the data belongs to, normally it is pretty much done with indexing. When you perform a query - whether in code, or for a web part view - each item in the list is examined individually for a match. As the amount of information in your sites grows, this can take quite a bit of time and cause significant slowdowns (This is independent of the "2000 item limit" - see sidebar).

Fortunately, you don't have to put up with this default behavior. SharePoint gives you the additional ability to index the information within individual lists or libraries.

Look at the settings page for just about any list or library, and you will find a link for "Indexed columns":

image

When you click the link, you will be given the opportunity to select which columns in your list you wish to index. This is where an understanding of your information, and how you use it comes into play. While you could just click everything, that isn't usually a good idea. For each column you index, SharePoint needs to store extra information about every item in your list.

You should only select columns for indexing that you will be using to query/filter, sort, and group your list. For this list, I'll usually need to do this with the item's title (or name), who created or modified an item, and when it starts. So those are the columns I'll select to index:

image

Note: When setting up indexed columns, you will almost always want to include the title or name field.

Once you click OK, SharePoint will build the appropriate extra indexes. While there won't be any change to the way your list looks, you should see the performance results almost immediately. (Of course, the more items in your list, the greater the impact will be...)

One place you usually see immediate results is when you click on the context menu of a column title to change the sorting or filtering. The list of unique values builds much faster on an indexed column.

image

That's all there is to it! Setting up indexed columns in your SharePoint list really is that simple. Give it a shot, and you might be surprised at how much faster your SharePoint applications can be.


Sep-32009

Calculated Columns and SPD Workflow Part 2

MCj02317860000[1]In this two part series, I show you how to take advantage of SharePoint calculated columns in your SharePoint Designer workflows. Part 1 introduced calculated columns. Part 2 will describe several string manipulation functions, and show you how to consolidate these calculated columns into a "function library" of sorts.

Hide the Clutter

In part 1, I showed you how to use a calculated column to enhance a SharePoint Designer workflow. This is all well and good, but what if you have interim calculations? What if you need to do this manipulation on values entered by your user in the workflow initiation form?  Or maybe you have other types of information you don't want getting in the way of your users when they view the list.

This is where that "Function Library" I talked about comes into play. Technically, in SharePoint terms, it is actually a function list. We will create a list in SharePoint that contains not just the calculated columns, but "input" columns for the functions as well. We will then hide the list in SharePoint designer. Your workflows can still access it, but your users won't even know it is there.

Holiday for Strings

String manipulation is a great application for calculated columns.

One common workflow scenario is processing the items sent to an email-enabled list. Typically, you will want to parse the subject line to find some routing information. This information may take several forms, including:

  • The beginning of the subject up to a delimiter
  • The end of the subject following a delimiter
  • The information contained within a pair of delimiters
  • Everything except what is contained between a pair of delimiters

Of course, there are other possibilities, but these should be enough to illustrate the concept.

Building the List

We're going to create a list that supports all of the calculations described in the previous section. To start, of course, we need to create the list. (Remember, SharePoint Designer 2007 doesn't have the ability to create or edit the columns in a MOSS 2007/WSS 3.0 list, so we'll do this in the web UI.)

  1. From Site Actions, select "Create"
  2. From the Create page, select "Custom List"
  3. Give it the name TextFormulas. Since we're ultimately going to hid the list, don't show it on the QuickLaunch
    image
  4. Click Create

Now that we have a basic list, we need to create our input columns:

  1. Display the newly-created TextFormulas list.
  2. From the Settings toolbar, select List Settings
    image
  3. There is a "Title" column created by default. Click on it, change the name to "SourceString", and click OK.
    Note: This step isn't technically required, but it helps things make sense in the Workflow Designer
    image
  4. Click Create Column
  5. Enter "Delimiter1" for the Column Name.
  6. Make sure "Single line of text" is selected as the field type, and click OK.
    image
  7. Repeat steps 4-6, except use "Delimiter2" as the column name.

Once you have your input columns defined, you might think it is time to create your calculated columns. While you could, there is one more step you might want to perform. Because the output from string calculations isn't always obvious, it can be helpful to have some sample data to work with so you can see if the formulas are doing what you want them to.

Add an item to your list:

image

This item will give you all of the possibilities that we might want to work with - text before, after, within, and outside of, delimiters.

Now we're ready to create the calculated columns.

For the first column we just want the text to the left of the first delimiter. This has the simplest formula, but it isn't necessarily as obvious as you might think. The formula is "trim(left([SourceString],find([Delimiter1],[SourceString])-1))"

We're using three string functions: Trim(), Left(), and Find(). They're also "nested", meaning that we're calling one function from within another function.

The obvious function is "Left()". It takes two parameters, the string we want the left hand side of, and how much of the string we want. Unfortunately, since this is delimited rather than a fixed position, we need to "Find()" the position of the delimiter in the source string.

That's all well and good, but why are we then subtracting 1? That's because we would otherwise return the delimiter itself in our results. Find returns the position of the delimiter, and Left function expects a count of returned characters. Since we don't want the delimiter, we subtract 1 so that we get the position immediately before it.

The Trim() function gets rid of any leading and trailing spaces, as even if you don't see them, these can make comparisons fail.

Create your calculated columns in accordance with this table:

Column Name Formula
BeforeDelimiter1 trim(left([SourceString],find([Delimiter1],[SourceString])-1))
AfterDelimiter1 trim(right([SourceString],len([SourceString])-len([BeforeDelimiter1])-2)
BetweenDelimiters trim(left([AfterDelimiter1],find([Delimiter2],[AfterDelimiter1])-1))
AfterDelimiter2 trim(right([AfterDelimiter1],len([AfterDelimiter1])-len([BetweenDelimiters])-2)
OutsideDelimiters [BeforeDelimiter1]&" "&[AfterDelimiter2]

Notice that each formula builds on the one before it - we're using the results of some calculated columns as input to others. This helps us avoid the 8-deep function nesting limit, as well as the 1000 character formula length limit. It also makes them a lot easier to read!

Assuming the formulas are entered correctly, viewing your sample data item will give you these results:

image

While the value for "AfterDelimiter1" doesn't look very useful in and of itself, that is only because of the particular SourceString we are using. In this case, it is simply an interim value for deriving the BetweenDelimiters result. With a different SourceString it could be the final answer you are looking for. For example, you may have a simple two-part source with a single delimiter, such as "G131131|Memory Failure". That string, with just the pipe (|) as Delimiter1, will result in "Memory Failure" for the AfterDelimiter1 value.

Back to SharePoint Designer

Once you have your function list created, you can use it in your SharePoint Designer workflows.

For this example, we're going to create a workflow on an email-enabled Time Off list. When a new item arrives, we want to parse the subject line to get the reason for the absence and assign it to the reason field. The reason text follows a dash (-), so we're just going to use the "AfterDelimiter1" calculated value.

Note: You may need to enable email-based workflows with the following command before using this example: "stsadm -o setproperty -pn declarativeworkflowautostartonemailenabled -pv true" See this KB Article for details.

When you define your workflow, first check the "Automatically start this workflow when a new item is created box, as shown below:

image

Click Next.

From the Actions menu, select Create List Item. (Since the menu is built from recently used actions, you may need to select it from the "More Actions" dialog.) You will get a new line in the Actions block that looks like the one below. Click the "this list" link.

 image

Select the TextFormulas list from the dropdown:

image

The SourceString (*) field will already be chosen, as it is a required field. (This will be the "Title" field if you didn't rename it earlier.)

Click the "Modify..." button. You want to use the E-Mail Subject field from the current item as the source.

image

After you click OK, Click Add in the Create New List Item dialog, and add the Delimiter1 field. Enter the dash as the Value. When you click OK, the Create dialog should look like this:

 image

Click OK. Notice SPD automatically generates a variable called "Create" as the output of this function. That variable will hold the item ID for the formula item we create. This will be needed later.

A Pregnant Pause

The next action may seem a little odd. We're going to select the "Pause for Duration" action, and then set it to 0 days, 0 hours, and 0 minutes. The reason for this is that the calculations in our function list item don't take place instantaneously. If we were to try to grab the result as the next step, all we would get is an empty string. By telling our workflow to Pause, we give SharePoint a chance to catch up.

Note: Even though we set everything in the pause to zero, the workflow will wait until the next event cycle to continue. This delay may be a minute or so.

Back to Work

Once the workflow comes back from its coffee break, we need to get our value back.

  1. From the Actions menu, select Set Field in Current Item.
  2. Click the "field" link, and select Reason from the dropdown.
  3. Click the "value" link, then click the fx button that appears.
  4. Select TextFormulas for the Source, with the Field of AfterDelimiter1.

Now we need to tell the workflow how to find the row we want. Here's where that "create" variable comes into play.

  1. Select the TextFormulas:ID field from the Field dropdown
  2. Click the fx button beside the Value field.
  3. Select Workflow Data for the Source, and Varable: create for the Field
  4. If your lookup dialog looks like the one below, click OK
    image

The reason lookup should now look like the capture below:

image

Click OK.

Cleaning Up

Now it is time to clean up after ourselves.

Just as "real" SharePoint developers need to keep in mind the need to "dispose" objects they create once they are done with them, we need to delete the formula record we created now that we are done with it. Fortunately, SharePoint provides a "Delete Item" action item for us. Select it from the Actions menu, and click the "this list" link. As you might guess by now, we're going to use the same "create" variable as before to select the item to delete from the TextFormulas list.

image

Click OK, then click Finish in the Workflow Designer. SharePoint Designer will then validate the workflow and save it.

Covering our Tracks

Finally, as I mentioned way back at the beginning of this article, you may not want your users to readily see your formula list. Especially since the interim information will be hanging around during that pause. Although we suppressed the list from the Quick Launch when we created it, people can still see it from the "View All Site Content" link. To make it go away from there, we can take advantage of SharePoint Designer's ability to "hide" a list.

To hide a list, first open the Lists folder (you won't need this step for document libraries).

Right-click the list you want to hide and select Properties, as shown below:

image

Click the "General" tab. Click on the checkbox labeled "Hide from browsers".

Click OK

image

Now the list will be "invisible" via most normal ways of discovering SharePoint content. That is also why we waited until after the workflow was done in order to hide it. Although you can still see and work with hidden lists in most parts of SharePoint Designer, the function called by the Workflow Designer to enumerate lists is the same one used by the web interface, so you wouldn't be able to select it.

Conclusion

This second part took a bit longer to write than I expected. I hope you found it worth the wait!

In these two articles, I have showed you the power of SharePoint calculated columns, and how to use them in a SharePoint Designer workflow. In the process, I have introduced a number of other concepts, including:

  • String functions
  • Hidden lists
  • Email enabling lists
  • Using the output of one calculated column to feed another.
  • Workflow variables

Even so, I have barely scratched the surface. I encourage you to explore further the capabilities of calculated columns and SharePoint Designer workflows.


Jul-82009

Share the Power

A Tale of Two "Points"

It was the best of times, it was the worst of times… No, wait – that's the wrong tale!

It was the best of Points, it was the worst of Points…

Today I'm going to talk about PowerPoint, and how the Microsoft Office SharePoint Server 2007 Slide Library takes it to the next level.
(Note: I originally wrote and published this article on my original blog site when MOSS was first released. It is just as relevant now, so I've decided to repost it here to be seen with fresh eyes.)

PowerPoint presentations are the lifeblood of many a corporate meeting; however, getting a consistent message across has been difficult due to the fact that a PowerPoint deck is one big file. Sometimes, it is one really big file. If you have certain key business information and you want to ensure everyone presenting "gets it right", your choices have generally been limited to providing a "standards" deck, containing all of your company's boilerplate, and making everyone pull out the slides they need; or going through the tedious process of saving each slide or small block of slides individually, then having your users merge each file them into their working presentation.

That can be very difficult, not only because you might have many such standard slides, but it means that the user needs to try to copy and paste them from the base presentation into their working copy, or merge many separate files. Finding just the right slide can be a task as well. Wouldn't it be great if you could just have each slide in its own file, and easily pick and choose which ones you wanted in your presentation? Well, with PowerPoint 2007 and MOSS, you can!

The slide library feature of MOSS allows you to create a repository of standard company slides, that is true, but because it is based on SharePoint, you can do so much more! Your library can include custom fields so you can make it easy to find just the slides you are looking for (e.g. sales figures, company policies, key executive bios), either by search, or by filter. You can separate slides for internal use only from those suitable for public consumption.

Creating a Slide Library

Creating a slide library in MOSS 2007 is just as easy as creating any other type of list or library - just go to the Create page, and select Slide Library:

You will then be asked the normal questions, like what you want to call it, if you want it on the quick launch, etc...

Accessing your library

Once you've created your slide library, you will want to populate it.

Open a presentation that has some slides you wish to re-use. Then, from the Office menu, select Publish, and click Publish slides.

Use the Browse button to select your site and library (and optionally folder), as normal. Now you can pick and choose which slides you want to save in the library, optionally renaming them and giving them new descriptions at the same time!

Now, what about getting the slides into a new presentation? Easy as can be! Open your slide library, tick the boxes beside the slides you want, and click the "Send to Presentation" link. You will be asked if you want to create a new presentation, or insert the slides into an existing one.

You can have the slides retain their original formatting, or assume the format of the target presentation. You can even have PowerPoint tell you if the source slides have changed since you inserted them into the presentation!

Conclusion

Microsoft Office SharePoint Server 2007 and Microsoft PowerPoint 2007 are both great products on their own, and even greater together. The MOSS slide library brings this integration to the next level. With a final apology to Charles Dickens:

It is a far, far better thing that they do, than they have ever done; it is a far, far better combination they bring than we have ever known…