Multiple Web Part Connections in SharePoint 2010

Unlike SharePoint 2007, SharePoint 2010 allows you to do more than one web part connection to a list view web part out of the box! That also means you can use more than one filter web part on a list view web part!

Here is a screen shot that exemplifies using multiple web part connections:

projectWPconn

In this screenshot, a user can filter by the project AND by the project phase to find related tasks. Sure you can filter the “Related Project” and “Project Phase” fields on the Tasks list view web part separately by clicking on each of the field titles and filtering them but using web part connections makes it easier for the user to switch between projects and project phases. Also, if the user is new to SharePoint, it’s not immediately obvious that you can filter by clicking on the field title, whereas clicking on a project to filter all tasks related to the project is more intuitive.

You can even add to this example by using filter web parts – ie. You can use a current user filter web part to show only the tasks assigned to you.

Being able to have multiple web part connections to a list view web part opens the door to all sorts of possibilities for slicing and dicing data within a list!

Advertisements

Visio Services – Using Visio & Web Part Connections to Highlight

In SharePoint 2010, you can use web part connections between a Sharepoint list and a Visio Web Access web part to highlight steps in a process diagram that are associated with a list item:

When you select a different list item, different steps in the process diagram are highlighted:

Here are the steps to build this example:

  1. Open Visio 2010, create a Visio diagram, and save it as a “Web Drawing” file type
  2. Upload the Visio file to a SharePoint document library
  3. In your Sharepoint site, create a web part page and add the Visio Web Access web part to the page. Edit this web part and set the web drawing URL to the Visio file URL
  4. Create a custom list and add a column called “Highlighted Steps.” Choose “Single line of text” as the column type
  5. Create a list item in the custom list. In the “Highlighted Steps” column, add the Shape name(s) that you want to highlight when you select this list item. If it’s multiple shape names, separated them with commas with no space in between. Ex) “Process1,Proccess1”. You can find the shape name by clicking on the shape information pane and then clicking the shape. The shape name shows up in the upper left side of the box. In the example shown in the picture, the shape name is  Process.3.
  6. On the page, add the list view web part for the custom list you created above.
  7. In the edit mode for the page, click the edit dropdown > Connections > Get Shapes to Highlight From > (custom list name)
  8. In the web part connection settings, set the Provider field name to the “Highlighted Steps” column and the Consumer field name to “Shape Names”. Click Finish

Now when you select one of the list items, it will highlight all the shapes associated with the list item.

Reference:

http://blogs.msdn.com/b/visio/archive/2010/02/05/no-code-mashups-with-visio-services-and-web-part-connections.aspx

Visio Services – Using Visio to Connect Processes

Unlike SharePoint 2007, SharePoint 2010 has a Visio web access web part that allows you to show Visio diagrams on your site. One way to leverage this new capability is to show a master detail view of a diagram/process. When you click on a shape in the “master” view, the “details” view will show the information associated with that shape. For example, when you click on the shape for “Phase 1” in the “master” view, the “details” view will show the sub-process related to Phase 1. This is especially helpful when you want both a high level and detail level view of a process.

Fig. 1: Clicking on the Initiation process shows the sub-process for the Initiation process

Fig. 2: Clicking on the Testing process shows the sub-process for the Testing process

These are the steps to build this example:

  1. Open Visio 2010
  2. Click New > Basic Flowchart > Create
  3. Click Save As > Change the file type to “Web Drawing” and save
  4. Create both your main process diagram and sub-process diagrams. Save the main process and sub-processes as two different Visio files.
  5. On the sub-process diagrams: change the page names for each sub-process
  6. On the main diagram: Select the whole process and right-click on the process > Data > Define Shape Data. Click New. Set the label to “subprocess” and type to string. Right click on the first shape > Data > Data Shape. Set the “subprocess” variable to the page name of the sub-process that is associated with the first shape. Repeat this step for all shapes in the main diagram
  7. Open your sharepoint site that you want to display these Visio diagrams
  8. Upload both Visio files to a document library
  9. On a page, add two Visio web access web parts – one is for the main process and one is for the sub-process
  10. Edit the main process Visio web part and set the web drawing URL to the main process Visio file url
  11. In the “Expose the following shape data” field, type the name of the label we created previously, which is “subprocess”
  12. Save the changes made to the main Visio web part
  13. Edit the sub-process Visio web part and set the web drawing URL to the sub-process Visio file url
  14. Save the changes made to the sub-process Visio web part
  15. On the sub-process Visio web part, click edit > Connections > Get Web Drawing URL and Page Name From > (the main process Visio web part) – Provider Field Name: subprocess, Consumer Field Name: Page Name. Click Finish
  16. Exit edit mode of the page (or Publish if the publishing feature is activated)

Creating Nintex workflow constants programmatically

Workflow constants in Nintex workflows are useful for storing constants that can be used across a site. For example, if you store a credential as a workflow constant, you can then use the constant within all Nintex actions that require credentials, such as the “Query User Profile” action. Then when the password is changed, the credential only needs to be changed in one place (as opposed to the case where the credentials are stored in each action and need to be changed within each action).

While you can create a site level workflow constant through the UI by going to the site’s settings and then “Manage workflow constants,” it’s possible to create a workflow constant programmatically.

Here is the code for that:

public static void CreateWorkflowConstant(string title, string description, string value, bool sensitive, Guid siteId, Guid webId, WorkflowConstant.WorkflowConstantType type, bool adminOnly) {

var oc = new WorkflowConstant(title, description, value, sensitive, siteId, webId, type, adminOnly);

oc.Update();

}

public static void CreateCredentialWorkflowConstant(string title, string description, CredentialValue cred, bool sensitive, Guid siteId, Guid webId, bool adminOnly) {

if (cred == null) return;

var serializer = new XmlSerializer(typeof(CredentialValue));

var sb = new StringBuilder();

using (var sw = new StringWriter(sb)) {

serializer.Serialize(sw, cred);

}

var value = sb.ToString();

CreateWorkflowConstant(title, description, value, sensitive, siteId, webId, WorkflowConstant.WorkflowConstantType.Credential, adminOnly);

}

static void Main(string[] args) {

try {

using (SPSite site = new Microsoft.SharePoint.SPSite(<SITE URL>)) {

SPWeb web = site.RootWeb;

var cred = new CredentialValue(@”am\jsaito”, “pwd”);

CreateCredentialWorkflowConstant(“title”, “desc”, cred, true, site.ID, web.ID, false);

web.Update();

}

}

catch (Exception e) {

Console.WriteLine(“Error: ” + e);

Console.ReadLine();

}

}

When you run it, you’ll find that a workflow constant is created on the site collection level:

WorkflowConstant

Workflow Constant added at the site level

Don’t Make Me Think!

I just finished reading “Don’t Make Me Think” by Steve Krug, which focuses on improving web usability. While this book discusses general web development/design, I saw a lot of lessons that could be applied to SharePoint, whether it’s for creating team sites or teaching users how to use SharePoint. Here are some key points I got out of the book:

  • People scan -> design pages for scanning, not reading
  • Use simple, easy words

Isn’t “Jobs” so much more easy to understand than “Employment Opportunities”?

  • Navigation and Search – the two ways people find info (so make sure they’re good!)
  • Minimal amount of words

This rule really applies to everything in life – essays, speeches, blogging, and yes, web sites. Krug suggests cutting at least half of the words. I think this rule really applies when people are writing instructions for say, filling out a new item in a sharepoint request list. People are not going to read paragraphs of instructions.

  • Use a good tag line and/or brief site description

If I go to any unfamiliar site, these are the first two things I look for – what does this site do and what can it do for me? Because if I can’t even figure out those two questions, I’m not going to even bother using the navigation or searching the site. Likewise, SharePoint site owners should include a brief description of their site for any newcomers.

  • Usability Testing

* Minimum 8 testers
* Watch as they test – recommend using a screen recorder to track them
* “Get it Testing” – show them the site and see if they understand the purpose, how it works, etc
* “Key Task Testing” – ask users to do something and see how well they do it

I know people scrimp on usability testing – I have. But it’s true – usability testing really works. Chances are what you think is obvious is not obvious to a new user. When I’m blogging about SharePoint features on our intranet, I try to have someone else look at my post first to make sure it makes sense. And when I’m writing out steps for a training, having another person test the steps really helps pin-point potentially confusing areas.

  • Usability as a common courtesy

Things that detract a user

* Hiding information that I want
* Punishing me for doing things my way

Make it obvious for users filling out an item in a SharePoint list what format you want the data in (ie. dashes in phone numbers, format of a person’s name as either their login or lastname/firstname)

* Putting sizzle in my way

Sometimes users want to put flash or large pictures on their home page to add pizzazz. Skip them – they increase the page load time.

 

Next on my list – The Design of Everyday Things!

Steps to Drive User Adoption

I just finished watching a Metavis webinar by Dave Coleman and Mark Miller. Here are some of the steps they’ve outlined to help drive user adoption that I thought were interesting:

  1. Show solutions, not functionality
  2. Solve a simple, real world problem
  3. Evangelize small wins
  4. Weekly office hours for company users
  5. Add little items of interest to your site: weather magnet, quote of the day, stock quote (via CEWP)
  6. Include site manager contact info on every page
  7. Find a champion and feed her
  8. Create a weekly newsletter – short & sweet, tips & tricks – links to source
  9. Build a “This is how we did it” category – instructions of how to do things in sharepoint
  10. Have the CEO answer a question a week on the front page of the site
  11. Pictures, graphs, videos, images

Another interesting observation to increase user adoption is to integrate SharePoint into the tools that people use everyday. Examples could be showcasing the integration between Outlook and SharePoint or RSS.

Also, Microsoft has a white paper! – SharePoint 2010 Adoption Best Practices

Powershell: SharePoint 2007 vs 2010

It still amazes me the differences between writing powershell for SharePoint 2007 and SharePoint 2010. For example, look at the differences when you try to find the number of spwebs within a farm that have a template “STS#1”:

2010:

Add-PSSnapin “Microsoft.SharePoint.Powershell”

(Get-SPWebApplication -IncludeCentralAdministration | Get-SPSite -Limit all| Get-SPWeb -Limit all | where{$_.WebTemplate -eq “STS” -and $_.WebTemplateId -eq “1”}).count

2007:

[System.Reflection.Assembly]::LoadWithPartialName(”Microsoft.SharePoint”)

$total = 0

$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local

foreach($spService in $farm.Services) {

if($spService -is [Microsoft.SharePoint.Administration.SPWebService]) {

foreach($webapp in $spService.WebApplications) {

foreach($site in $webapp.Sites) {

foreach($web in $site.AllWebs) {

if($web.WebTemplate -eq “STS” -and $web.WebTemplateId -eq “1”) {

$total +=1

}

}

}

}

}

}

Write-host $total