How to Optimize SharePoint Designer's Use of Content Types in a Workflow

June 15, 2007

I'm annoyed by many little details of the SharePoint Designer Workflow editor, but the main one is that it profligates in the creation of content types. It creates one content type for any custom form that you create when collecting data from a task. Moreover, it doesn't give you the chance to reuse an existing type....every new task is a new content type in the Tasks list.

blog spd newct 300x185 However, you CAN reuse existing content type for the Tasks list. You just have to create the first form as usual and then create a second form with a easy-to-find name such as "DUMMY". Then, a little bit of manual work follows:

  • Open the XOML file of your workflow with right click, choosing "Open With" then "SharePoint Designer (Open As XML)

blog spd openxoml 300x90
  • Find the first "CollectDataTask" action, such as this one
    <ns0:CollectDataTask x:Name\="ID15" ContentTypeId\="0x01080100AC1C1A96057F4B4897ED6C99E92728F500A85399B392A23943B207F10B3F8BB318" TaskId\="{ActivityBind ROOT,Path=taskAM}" Title\="CAF Approval 1" InProperties\="{x:Null}" \_\_Context\="{ActivityBind ROOT,Path=\_\_context}" OutProperties\="{x:Null}" AssignedTo\="{ActivityBind ROOT,Path=userAM}" />  
  • Copy the line after the x:Name field

  • Find the CollectDataTask with the Title="DUMMY"

  • Replace the content of the line after the Name field with the first action copied data

That's it! Now you can safely remove the DUMMY content type from the Task list and Site Content Types list.

Profile picture

Written by Edin Kapić Insatiably curious code-writing tinkerer. Geek father. Aviation enthusiast. Cuisine journeyman. Follow me on Twitter