Nick Grattan's Blog

About Microsoft SharePoint, .NET, Natural Language Processing and Machine Learning

Archive for the ‘SharePoint Designer’ Category

Changing the Task list for SharePoint Designer Workflows

with 15 comments

By default, SharePoint designer will automatically select an existing Task list or create a new one if a suitable Task list does not exist. To change the Task list being used:

  1. Create a new Task list using Site Actions + Create.
  2. Find the Id (Guid) for this new list following the technique described in my blog entry here.
  3. Using SharePoint Designer, open the site where the workflow exists, expand out the “Workflows” folder and the workflow whose Task list is to be changed.
  4. Locate the file called workflowname.xoml.wfconfig.xml and open this file for editing.
  5. Take the Id found in (2) above and replace the Id in the “<Association>” element’s “TaskListID” attribute.
  6. Save the file.

 

Written by Nick Grattan

April 29, 2008 at 11:32 am

Finding the Id (Guid) for a SharePoint List

with 48 comments

There are times when you need to find the Id (a Guid) of a list – for example, when setting the Task list to be used with SharePoint Designer Workflows (see my blog post here). Here’s a simple way of doing this:

  • Navigate to the SharePoint list using the browser.
  • Select the Settings + List Settings menu command.
  • Copy the Url from the browser address bar into Notepad. It will look something like:

http://moss2007/ProjectX/_layouts/listedit.aspx?List=%7B26534EF9%2DAB3A%2D46E0%2DAE56%2DEFF168BE562F%7D

  • Delete everying before and including “List=”.
  • Change “%7B” to “{”
  • Change all “%2D” to “-“
  • Chnage “%7D” to “}”

You are now left with the Id:

{26534EF9-AB3A-46E0-AE56-EFF168BE562F}

Update: See Ken’s Comment for a simpler solution (thanks!):

A (slightly) easier way if you have MOSS 2007 is to go to the List or Library settings as described above, then right-click on the “Audience targeting settings” or “Information management policy settings” links and choose Copy Shortcut.

You can then paste the URL and there’s no need to decode the GUID. For some reason these links aren’t URL encoded.

Update: These techniques work for SharePoint 2010 Standard/Enterprise editions as well. Using Ken’s tip does not work for SharePoint 2010 Foundation as these list settings options are not available so you’ll need to use my first suggestion in this case.

Update: And it works for SharePoint 2013 too!

Written by Nick Grattan

April 29, 2008 at 11:10 am

Microsoft SharePoint Designer Workflows – Things is doesn’t do

with 11 comments

Creating workflows with the Microsoft SharePoint Designer is quick and simple. However, there are number of distinct limitations which you need to be aware of, such as:

  • Workflows have no looping or flow control statements. Workflows execute serially from the top to the bottom. Implementing flows such as “continue executing until approval is made” becomes problematic.

Update 25 Nov 2009: See this post for how while loops can be simulated using stateful workflows with Microsoft SharePoint Designer.

  • Workflows can only be associated with lists, not content types. This can be limiting when you allow, for example, users to select one of a number of InfoPath forms on the “New” menu and you want different workflows depending on the type of document created.

Update 25 Nov 2009: You will have to wait until SharePoint Designer 2010 and SharePoint 2010 for this!

  • Workflows are associated with a single list. You can, though, using the technique described here copy them to other lists.

This list doesn’t include limitations in the standard actions provided by Microsoft SharePoint designer – custom actions written in Visual Studio can help in this case.

Written by Nick Grattan

April 14, 2008 at 3:08 pm

Using the XmlFormView Web Part with InfoPath Forms

with 33 comments

In this earlier post I briefly describe how to embed an InfoPath form in a SharePoint Web Part Page using the XmlFormView web part. I’ve been asked on many occasions to provide a more detailed account.

You can find the step-by-step guide to embedding an InfoPath form in an XmlFormView web part in a white paper here: How to Host Microsoft InfoPath Forms in SharePoint Pages. This document also shows how to create a Submit button to override the normal “Save” option on InfoPath forms.

Updated September 2009: Now includes instructions on creating a web part page using Microsoft SharePoint Designer for XmlFormView web parts. This is much easier than using the browser.

Written by Nick Grattan

December 19, 2007 at 1:31 pm

Applying a SharePoint Designer Workflow to multiple Lists

with 26 comments

When using SharePoint Designer to create a workflow you are required to bind the workflow to a particular list:

Wf1

The problem is that you cannot from this interface bind the workflow to other lists.

You might be tempted to use the “Save List as Template” option in the List’s settings, and then create a new list based on this template to create a list that uses the workflow. The problem is that the workflow is still bound to the list from which the new list is based, and an error will probably be generated whenever you try to start an instance of the workflow – the steps will try to reference items etc. in the original list.

In SharePoint Designer you can expand out the files associated with a workflow:

Wf3

The “.xoml.wfconfig.xml” file contains information on the list the workflow is bound to using the List’s ID (a GUID): 

Wf2

The file “.xoml.rules” contains the ‘conditions’ you program for the workflow and the “.xoml” file contains the ‘actions’. The “.aspx” form is displayed when the workflow is started manually.

To re-use a workflow in another list:

  1. Create a new workflow on the new list.
  2. Create at least one step, one condition and one action in this workflow. This ensures that the files shown above are created and they will be replaced by the next operations.
  3. From the original workflow open the .xoml file as XML and copy the entire contents to the clipboard.
  4. Open the .xoml file for the new workflow and replace the entire contents with the copy from (3).
  5. Repeat this operation for the xoml.rules file.
  6. Double click the .xoml file for the new workflow to open the workflow in the Workflow Designer and click Check Workflow to verify no errors and then click Finish to ensure the workflow is saved.

I’ve tested this technique with simple workflows and the process works well.

 

 

Written by Nick Grattan

October 17, 2007 at 12:08 pm