Archive: SharePoint Designer Workflow 2010 – Task Actions

This article was originally written in July 2012.  It is being reposted here as an archive.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I’m currently working on putting together a SharePoint Saturday session on the new 2010 Task Process in SharePoint Designer.  This is part of my “Lessons Learned” articles to help me organize my thoughts to prepare for this session (SPSNY – July 28, 2012).

In SharePoint Designer 2010, you can choose six different task actions to create and assign a task.  I personally prefer the more robust Task Processes, but it’s important to understand what the other Task Options that are available to you are and how they work.

SharePoint Designer 2010 Workflow Task Actions

SharePoint Designer 2010 Workflow – Task Actions

The following items are true for the first three actions (Assign a Form to a Group, Assign a To-do item and Collect Data from a User):

  • You are prompted for  a task name and description through a task wizard
  • The task is added as a site Content Type and fields you create are added as site columns

o   Content Types are added to “Custom Content Types” Group

o   Fields are added to “Custom Columns” Group

o   Field names are given a GUID internal name, such as: _C3C1C1F5_9957_43D5_ABB

  • The only outcome available is to “Complete Task”

o   Cancel just closes the form, it does not cancel the task

  • Workflow remains paused until each task is completed

o   If  Jim and Joe are each assigned a task and Joe goes on vacation, the workflow remains paused until Joe gets back and completes the task

o   If you assign to a group, “Claim Task” is available if you have Enterprise

  • Note: If you a assign a task to a group, that counts as one task and only one person in the group needs to complete it for the workflow to move on to the next step.
  • There is no way to set task fields, such as Due Date, Priority etc. in the workflow.

o   To set other task fields, such as Expires, Priority, etc. you must add create a secondary workflow and apply it to the task

  • Note: I have not been able to successfully run a workflow on a workflow task in SP2010.
  • There is no way to send an email to the assignee via the running workflow.

o   To send an assignee a task notification, email notifications must be turned on in Task List OR users must sign up for Alerts

o   You can’t customize these notifications

  • Note: You can’t use the workflow to send notifications because it pauses after creating the task until it is complete

Assign a Form to a Group (Available in SPD2007)

  • Allows you to add fields to the task form to request information from the person or group the form is assigned to

o   Responses to task fields are stored in task list

o   No way to access these responses in the workflow

  • You could use a workflow action to look up the field in the task list (I used the Task’s Workflow Item ID =Current Item Id) BUT this will not work if you have several tasks created during the workflow or run this workflow more than once.
SharePoint Designer 2010 Lookup Current Item ID

SharePoint Designer 2010 Workflow – Lookup Current Item ID

  • Field Types Available: (all can be set to allow blank values):

o   Single Line of Text

o   Multiple Lines of Text

  • Plain, rich or enhanced rich

o   Number field

  • Can set min/max values, set decimal places or set as percentage

o   Currency field

  • Can select currency, set min/max values,  set decimals places

o   Date and Time

  • Date or date and time

o   Choice Field

  • Checkboxes or dropdown, can allow fill-in choices
SharePoint Designer 2010 Workflow Initiation Form Fields All Field Types

SharePoint Designer 2010 Workflow Initiation Form Fields – All Field Types

Assign a To-Do Item (Available in SPD2007)

  • Assigns a task but does not include a form to collect any information from the user.

o   The form displays the form name, the description and Complete Task and Cancel buttons.

SharePoint Designer 2010 Workflow Assign a To Do Task

SharePoint Designer 2010 Workflow – Assign a To Do Task

Collect Data from a user (Available in SPD2007)

  • Works exactly like the “Assign a Form to a Group” action, except it stores the ID of the task in a variable, which you can then use later in your workflow to lookup the contents of the field in the task list.

The following is true for the last three options (Approval Process, Custom Task Process, and Feedback Process).  You can:

  • create new fields or use existing site columns to assign to the task

o   the same field types as “Assign a Form to Group”, plus “Person or Group” field and “Hyperlink or Picture”

  • determine what happens before, during and after a task is created, assigned and completed
  • set rules on how to determine if the task process should end
  • set basic task fields, such as “Due Date” and “Priority” or give the user X number of days to complete their tasks before it is considered overdue
  • send customized task notifications and emails to the workflow initiator, assigned to and anyone else you need to during the process and cc: people as needed
  • set rules to send reminders before and after the due date

o   set the frequency of reminders after the due date to Daily, Weekly or Monthly

o   determine how many reminders will be sent to the assignee

  • allow assignees to reassign their task to someone else
  • allow assignees to request a change from someone else
  • assign multiple tasks within the same task process
  • tell the workflow what to do with the task if the item the workflow is running on is changed or deleted
  • determine if the task should be kept or deleted upon its completion
  • determine if everyone in a SharePoint group you assign a task to should get their own task or if just one task can be created for the entire group
  • create simple or complex if/then scenarios throughout the process.

As with the first three actions, the following is also true:

  • The task is added as a site Content Type and fields you create are added as site columns

o   Content Types are added to “Custom Content Types” Group

o   Fields are added to “Custom Columns” Group

o   Internal field names are a numerical GUID

Approval Process

  • Comes with prepopulated task processes that can be edited as needed

o   See Custom Task Process images to see what options can be set.

  • Default Outcomes – Approved, Rejected

o   These outcomes can be changed

Custom Task Process

  • Gives you the framework of the task process, but is completely blank so that you can start from scratch

Task Process Settings:

SharePoint Designer 2010 Workflow Task Process Settings

SharePoint Designer 2010 Workflow – Task Process Settings

Task Settings:

SharePoint Designer 2010 Workflow - Task Settings

SharePoint Designer 2010 Workflow – Task Settings

Task Process Completion Conditions:

SharePoint Designer 2010 Workflow Task Completion Conditions

SharePoint Designer 2010 Workflow – Task Completion Conditions

Feedback Process

  • Comes with prepopulated task processes that can be edited as needed

o   See Custom Task Process images to see what options can be set.

  • Default Outcomes – Completed (Submit Feedback)

o   These outcomes can be changed

I personally favor the task processes that are listed as the last three task actions available.  I’ve listed some of the cool things they can do above, but I plan to go into much more detail about all the things you can do and some pitfalls to avoid in future articles.

 

Archive: SharePoint Designer 2010 Advanced Settings

This article was originally written in Aprile 2012.  It is being reposted here as an archive.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I’ve recently spent a lot of time on SharePoint 2010 workflows.  I made a ton of errors and learned a lot about the new Task Process in 2010.  It may look easy, but there are a lot of things that can go wrong.

I’m currently working on putting together a SharePoint Saturday session on the Task Process.  I will be writing a few “Lessons Learned” articles to help me organize my thoughts to prepare for this session (not yet determined when or where).  I will cover the following topics in more details in upcoming articles: Association and Initiation Forms, Change the behavior of a single task, Change the behavior of the overall task process, Change the completion conditions for this task process, the difference between assigning tasks and starting a task process.

This article is specifically about the Task Process “Advanced Properties”.

It is not immediately noticeable that a task process has advanced properties.  If you click on the name of the task, you are taken to a Task Settings page that allows you to change certain settings.  However, there are certain settings that you may not know to set since you do not see it anywhere except for in the task’s Advanced Properties.  I will notate these as I go through each one below.  Many of the issues I encountered were because these settings had changed or disappeared through the course of my iterations of the workflows.

These settings apply to the three Task Processes that can be added from “Action, Task Actions” and include the word “Process” – Start Approval Process, Start Custom Task Process, Start Feedback Process.

WFA-Image1

I highly recommend completely setting up your task process and reviewing these settings at the end.  Many of these options will be blank when you first set up your task process and will be automatically populated in the course of customizing your workflow.

To view the advanced properties, click on the task process row and click on the drop down button that appears on the right.  Then Select Properties, which will show you some settings and variables that are specific to that task process.

WFAImage2

WFAImage3

Here is a list of all the Properties available.  These are the same for all three task processes.

Note: you will see that some items are “Variables” and some items are “Parameters”

o   Variables are hidden from end users, but the workflow needs to function

o   Parameters  may be included on a form or setting for user input

General Property Variables:

  1. Content Type ID – this is a read only field, you cannot set the Task Content Type here.  If you need to assign a custom content type to a task process, click here for instructions:  Assign a Custom Content Type to Task Process in a SharePoint Designer 2010 workflow
  2. Allow Change Request –will prevent or allow the assigned user to request a change to the page or document being reviewed.

o   This option can be changed from the Task General Settings page (see print screen below)

o   This option will generate a button on the form and a corresponding outcome

o   Selecting this option will mark the current task as complete, assign a new task to the person a change is requested from.  Once that task is marked as complete, a new task will be created to the person that requested the change to review the change and complete the task process.

  1. Allow Reassign – will allow the assigned user to reassign a new task to someone else.  This will mark the current task as complete with an outcome of delegated to:  new person.

o   This option can be changed from the Task General Settings page (see print screen below)

o   This option will generate a button on the form and a corresponding outcome

o   Selecting this option will mark the current task as complete and assign a new task you want to reassign the task to.

WFAImage4

  1. Delete Tasks on Complete – Setting this to “Yes” will delete the task once it has been completed or canceled.

o    You may want to consider this if you will be generating a large number of tasks with workflows.

o   If you are collecting data in the workflow task that you need to retain and you need to delete your tasks, you should include steps in your workflow to place that data somewhere else; in your page or document the process is acting on, for example.

  1. Expand Groups – This setting only applies if you are assigning tasks to SharePoint User Groups.

o   Yes means that each person in the group will get an individual task assigned

o   No means that one task will be created and a member of the group will have the option of claiming the task, which will reassign the task from the group to the individual.

o   This default can be set with the Initiation Form Parameters

WFAImage5

o   You can also leave this option on your workflow initiation form and allow the workflow initiator to select the appropriate option.

  1. Permission Set – This is asking if you want to use the permissions of the task list (default) or set permissions for these tasks so that only people that are assigned to a task, workflow initiators and admins can see tasks.

o   This is set to “Default” by default.

o   This can be set on the Task Settings page.  If you check the box to “Only allow task recipients and process owners to read and edit workflow tasks SharePoint will set this variable to “AssignedTo”

WFAImage6

  1. Task Deleted Outcome – This is asking what the task outcome should be logged as if someone deleted a task.  By default this is blank.   You can enter “Deleted” or “Cancelled” or something that will let someone reviewing the workflow history know what happened to the task.
  2. Task Process Owner – Lists who owns this task process.  If you change the permissions of the task “PermissionSet” then this user or group will have access to all the tasks as the owner.

o   This can be an individual or a SharePoint group.

o   You can set this in the Task Information section of the task general settings page.

WFAImage7

  1. Send Default Task Notifications – pay attention to this one.  If you are sending a custom task notification to a user as part of the process, mark this as “No”.  Otherwise it will change the default setting of your task list no notify users when a task is assigned.

o   Personally, I prefer to customize the task notification message, so I mark this as “no”

o   If this is set to “Yes” it will send the automated message below from the Task List this task resides in (the variables in <> below will be populated by the task or item)

WFAImage8

 

Parameters for “[Task Process]”

  1. Task Process Name – This is the name of the Task Process, which may be included in notifications, depending on how yours are set up.  You can also change this setting in the Task General Settings Page under Task Information.

WFAImage9

  1. Overdue Repeat – Set this parameter if you want to send a notification to a user when the task is overdue.  Your options are Off, Daily, Weekly or Monthly.

o   You have the option of customizing the email that is sent in the Task Process.  That will be covered in another post.

WFAImage10

o   The default setting is weekly.

 

  1. Overdue Repeat Times – How many reminders do you want to send to the person or group a task is assigned to?  You can enter a set number, or enter -1 for infinity.  This means SharePoint will keep sending a reminder on the schedule that you listed in the previous parameter until the task is marked as complete, the task process is cancelled or the task is deleted.

WFAImage11

o   The default setting is infinity

 

Parameters for “[this item]”

  1. Item ID – Do not change this option.  It is defaulted to the Item ID that the workflow is running on.

Parameters for “[these users]”

These variables can also be set in the workflow task using the “Set Workflow Variable” action or when you click on the link to start the task process with “these users”

WFAImage12

WFAImage13

  1. CC: – This variable is asking if an individual or group should be copied on emails regarding this task process.

o   Unless you are setting your workflow so that every workflow copies a certain person or group, I would leave this as “Parameter: CC”.

  • You can include this parameter on the initiation form for a person starting the workflow to complete or you can set with workflow actions if the workflow will be started automatically.
  1. Comments – Important:  if “Parameter: Comments” is not listed here, then if your workflow can be manually started and you allow a workflow initiator to enter comments when manually starting the workflow, they will be lost.  They will not be included in the emails or on the “Task Process Consolidated Comments”

o   The alternative is to enter static text here or to enter static text when you are adding a workflow to the list, library or content type

  1. Subject – Default subject of task notifications.

o   I personally do not complete this one because I make each task notification subject different depending on how complex the workflow is.

  • For example, a reassigned or change request task gets a different subject that an original task.  Or a task assigned to a group will have a different subject than a task assigned to an individual.
  1. Duration – the number of days, weeks or months that a person has to complete a task

o   You can set this parameter here, in the overall workflow process itself, or when adding the workflow to the list, library or content type.

o   Make sure this is as least set as “Parameter: Duration” in the advanced.

  1. Duration Unit – days weeks or months

o   You can set this parameter here, in the overall workflow process itself, or when adding the workflow to the list, library or content type.

o   Make sure this is as least set as “Parameter: Duration Unit” in the advanced settings.

  1. Due Date – If you’d rather set an overall due date for the entire task process you can set it here.

o   You can set this parameter here, in the overall workflow process itself, or when adding the workflow to the list, library or content type.

o   Make sure this is as least set as “Parameter: Due Date” in the advanced settings.

An example of the screen when you are assigning a workflow to a list, library or content type is below.

  • Note the parameters that you can set here or in the Task Process’s advanced settings.
  • You can make these fields available to a workflow initiator or hide them.

WFAImage14

 

I would love to hear if this has been helpful for you.   Have a great day!

Archive: SharePoint Designer 2010 Workflows – an alternate deployment option

This article was originally written in April 2012.  It is being reposted here as an archive.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I love SharePoint Designer and all the cool things you can do with it as a no-code solutions expert.  I love the concept of being able to save a globally reusable workflow as a Site Template and deploying it to other site collections via Visual Studio or Sandbox Solutions.  Unfortunately, we ran into some major issues when trying to deploy a .wsp file from a local machine to our development server to the client’s stage server and finally to production.

I worked with one of our developers to try and deploy workflows through Visual Studio.  Unfortunately, for a variety of reasons, we couldn’t get it to work.  You can read his take on our deployment adventure in his 3-part blog here:  Importing SharePoint Designer Workflows into Visual Studio – Part 1, Part 2 & Part 3.

After spending way too much time on that process, we decided we were going to use the process that Microsoft gave us; Save as a Template, upload into User Solutions, Activate and then turn on the feature.  In theory, this sounds great.  Unfortunately, we ran into a bunch of issues with this process too…including variables getting messed up, empty folders being created, changes not updating, buttons not working, InfoPath form customizations getting lost, etc.  We would resolve one issue and the next time, a totally new one would pop up.  The worst thing of all was that when we deactivated the feature and removed the solution, our out-of-the-box task fields that the workflow used were removed too!

As a last resort, I decided to try the same thing that I did when I needed to get a workflow in SharePoint 2007 from one site to another:  Copy and Paste.  Yup, that’s right, I just copied and pasted a workflow from one site to another, did a quick “Find and replace” of GUID’s for list ID’s and I was able to use the same workflow on multiple sites, my own 2007 version of a reusable workflow.

I thought it was my own little secret way until I just searched for and found this post by  Paul Galvin that gives great step-by-step instructions for moving 2007 workflows:  https://www.nothingbutsharepoint.com/sites/eusp/Pages/why-can_e2_80_99t-i-easily-port-sharepoint-designer-workflow-solutions-from-one-list-to-another-part-2.aspx).  The only thing missing is that you will need to do a Find and Replace of the GUID’s once you have the workflow in its new home.  I have only used this method for copying workflows from one site to another in the same site collection in the same environment.  I do not know if it will work from environment to environment.

Here are the updated instructions for SharePoint 2010.

Some notes about these instructions:

  • Workflows were created as Reusable workflows and were not associated with any lists or content types.
  • I created these workflows on a subsite so they could be tested, then copied it up to the parent site where I could then globally publish them on our development environment and then followed the same process on our production environment.
  • Our site columns and content types were created through Visual Studio so that all of our environments have the same GUID’s.  If you are not able to have a developer do this, then you may need to do a few extra steps listed at the end to re-align everything.
  • These workflows do not include any lookups to other site lists, but they do include global site columns.

Here is the process that worked best for us.  These steps assume that you have completed your workflow, it is fully tested and you are ready to move it to its new home.

First we need to make sure that the workflow’s new home has a “Workflow” folder for it to be moved to.

  1. In the site where you will be moving your workflow, go to All Files (see print screen below if you get a blank screen) and confirm that there is a “Workflows” folder.

SPDImage1

  1. If there is not, create a new reusable workflow.  Don’t worry about adding in steps or publishing it…we are just doing this to create the folder.

SPDImage2

 

The following steps happen on the site where the workflow that you want to move currently exists.

  1. Click on “All Files”
  2. Click on the “Workflows” folder
  3. Click on the name of the workflow that you want to move, right click and select “Copy” (or select and click Ctrl +C)

SPDImage3

  1. Go to the workflow’s new home, “Workflows” folder
  2. Paste your folder in the “Workflows” folder by either clicking “Ctrl+V” or right click and select “Paste”
  3. Now click on Workflows link SPDImage4  in the left navigation and open your workflow.
  4. If your form has any out of the box Association or Task InfoPath forms, delete them and let the new site re-generate them for you.

NOTE: If you customized the Initiation and/or Task InfoPath form, click on them to open InfoPath and publish them.  SharePoint will do some back-end magic that will associate your form with this workflow on this site.

SPDImage5

NOTE: Your Task form may have a different name with “Copy” if you are using the out of the box task form.  If you need to associate a custom content type task form to your workflow, check out this article:  Assign a Custom Content Type to Task Process in a SharePoint Designer 2010 workflow

  1. Click through all the steps in your workflow or click on Check for errors to confirm that everything is aligned correctly.

o   This is where you may need to delete remove associated fields and re-add them.  Or delete fields that you are populating and re-add them in the new environment.

  • Since all of our fields and content types were created with code and the GUID’s matched, I don’t have any examples to show.

SPDImage6

 

  1. If you need to make your site globally available, paste your workflow in the “Workflows” folder on the parent site and you can click on “Publish Globally” from here.

SPDImage7

Notes about globally publishing a workflow:

  • I don’t recommend copying and pasting directly into the global workflows folder.  In theory I think it would work, but I don’t know enough about what SharePoint magic happens to make a workflow globally available, and I’d rather be safe than sorry.
  • If you have a globally published workflow that you need to add to a content type, don’t add it during business hours or during times where users may actively be editing that content type…they may lose their information as your changes override theirs.

o   The same goes for re-publishing changes to the global workflow.

  • If you have custom InfoPath forms, the process of globally publishing it will generate a new out of the box form.  To replace this, copy the forms from your “All Files ->Workflows” folder and paste into the Global Workflows folder: “All Files ->_catalogs ->wfpub”

SPDImage8

 

 

Archive: Connect to multiple sub-sites in Data View Web Part

This article was originally written in April 2012.  It is being reposted here as an archive.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In SharePoint 2007, the Data View Web part (DVWP) was all the rage.  You could create complex views from multiple sites within in your site collection or other data sources and group, sort and format the data in a visually appealing and meaningful way.

SharePoint Designer 2007 made it easy for you to connect multiple lists on sub-sites with a handy little “Connect to another library…” link at the bottom of the data sources task pane.   With all the improvements Microsoft has made with the Content Query Web Part, I was excited to use the DVWP as a sort of expanded version of information that I show in a CQWP.    However, SharePoint Designer 2010 has gotten rid of the task pane and the handy little link that allows you to quickly connect data sources to display in the DVWP.  Out of the box you can see you site’s document libraries and lists in the data sources.

So the question is, how do you combine data from multiple sub-sites to display in a consolidated list?  For this example, I have 8 departments and each department has a sub-site.  Each of these sub-sites has a “Goals” list that uses a global content type in a custom task list.  I want to consolidate each department’s goals on the parent site to display a view the company-wide goals.

Inbar Cizar (@Cizi) does an excellent job of explaining how to add a sub-site’s list to your list of data sources in this post:  http://blogs.microsoft.co.il/blogs/cizi/archive/2010/08/01/connect-to-another-library-in-sharepoint-designer-2010.aspx

Once you have added each of your department’s goals as a data source, you will need to create a “Linked Data Sources” and use this Linked Data Source in your Data View Web Part

Image1-Data Sources for DVWP

Then open an existing or create a new page (I used  an .aspx page).

On the ribbon, click on the down arrow on the Data View button and select your Linked Data Source.

Image2-DataViewButton

From there you can add your columns, group, sort and modify the DVWP as needed.

 

Image3-SOAPServices

NOTE:

Name your SOAP datasources carefully; you can use the name of the connection to group or sort a DVWP by the name of the sub-site, or whatever you call it.  After the datasources have been connected as a Linked Source, any name changes are not reflected, so you will need to create a new Linked Source to reflect a name change.

Here are instructions to group the DVWP by the site name, which is what I named the SOAP Service datasource.

  1. Call your “SOAP Services” data source the name of your sub-site.
  2. Click on sort and Group
  3. Select “Add Sort Expression…”
  4. Select “agg:source”

Archive: Manage Content Owners with the Content Query Web Part (CQWP)

This article was originally written in February 2012.  It is being reposted here as an archive.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The CQWP is my absolute favorite out of the box web part.  There are so many things that you can do with it.  There are lots of great blogs out there describing how you can present information to your end user with the CQWP, but did you know that you can also use it to determine how your content owners are using their sites?  Are they entering the type of data that you expected them to when you created your form?  Do content owners understand the importance of certain processes, such as clicking on “Publish” to make a page visible to readers?  Did your users really “get” the training that you gave them?

The current project I am working on is getting ready for a huge launch.  It is a publishing site with minor and major versioning turned on for Pages and Document Libraries.  It is one parent site with 100+ sub-sites, each containing hundreds of pages and documents.  We created a custom web part for content owners to link to other pages in the site collection.  This web part is really cool in that it shows the name of the page or document, the date it was reviewed, user ratings, a brief summary of the content and a link to the page or document.  We want to give the reader some useful information about the link before they decide to click on it.

With so much content in the site, we are relying on content owners to enter information about the content in a field that will be displayed in FAST Search and will also be displayed in the custom web part to link to related content.  The web part respects security, meaning a user must have access to the content in order to view the description in the web part.  With a big launch coming up, I wanted to do a content check to see how we are doing.  I don’t have time to go randomly clicking around on all these sites, so I created a couple of CQWP’s in order to see how the site is being populated.  They also ended up helping our development team complete a final review of our work.

If you’re new the CQWP, it is a web part that you can add to a web part page that can ask all of the sites in your site collection to give you a certain kind of information.

For example, if this wall of candy dispensers is your site collection, with each dispenser being one site:

CQWP1

 

Then this is the CQWP:

CQWP2

It has done all the work for you and grabbed multiple types of candies for you to consume quickly.  Yes, I could go to each tube and grab a little from each…but that just takes way too long and I want my candy NOW J.  With the CQWP you can filter your candy to get the specific ones that you need (if you don’t want the brown ones you don’t have to have them).

The CQWP is out of the box when the publishing feature is turned on, and it’s pretty quick to configure, especially with practice.  Here are some examples of how I was able to spend a few minutes looking at how the users are using the site and avoid deployment issues.  All of these queries were done in a browser, with no .xslt edits.  Each took no more than 15 minutes to configure, check, adjust, check, etc. to show exactly what I want on the page.

  • Check on published versions

o   Created 2 queries, one for all “Pages” libraries and one for all “Document Libraries” across the site collection, filtered by version is less than 1.0 and displays the last person that modified the content.

o   Problem Avoided:  Users not being able to access pages with page not found error, access denied errors and empty custom web parts

  • In order for a site reader to see a page or document the user must publish a page, or check in a major version.
  • This makes the version 1.0 (or 2.0, 3.0, etc. as you publish major versions…drafts always have a decimal).  A document that does not have a published version will have a version less than 1.0, which is why I filtered for by version.
  • There were over 400 pages and documents that did not have a published version just two weeks before go live

 

  • View user-completed fields

o   Created 2 queries, one for all “Pages” libraries and one for all “Document Libraries” across the site collection, which display the page title and our custom summary field and the content owner.

o   Problem Avoided:  Poor search results, poor cross-site link descriptions

  • There were over 300 items with “-“, an incomplete description or a duplicate description in the summary field that is displayed in our custom web part and search results.
  • Validation or unique values were not viable options in this case.

 

  • Discover users storing documents in wrong locations

o   Created one query for all sites, grouped by Page Layout, which showed users were putting Word and .pdf documents in their Pages Libraries (since they had no page layout)

o   Problem avoided:  Documents stored in wrong locations would not display correctly to the end user

  • We created Pages Libraries for publishing pages and Document Libraries for all stand-alone documents.  All documents are presented with a custom page that displays certain properties, taxonomy, user comments and ratings.

The overall outcome of these CQWP’s is that we were able to target the users that needed additional training tips in order to make sure their content is not only visible, but findable for end users on launch day.

Additionally, CQWP’s helped our development team to create a better product:

  • Monitor page layout usage and react

o   This was a unique project where editors were adding content while we were developing the site.  By creating CQWP’s that grouped all Pages by Page Layout we were able to:

  • View how users are actually using the page layouts we designed with content and adjust as needed
  • Allow our front end developer to make changes to design based on usage
  • Allow our back-end developers easy access to test the pages and how they worked with our custom controls and actual content

If you’re not familiar with the content query web part, I strongly recommend spending some time getting to know this very powerful web part.  It has been the fastest way for me to get feedback on what’s going on in our sites, so that we can address training issues, user adoption and design before they become a problem.

 

 

Archive: Assign a Custom Content Type to Task Process in a SharePoint Designer 2010 workflow

This article was originally written in February 2012.  It is being reposted here as an archive.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SharePoint Designer 2010 has some awesome new features!  Two of my favorites are (1) the ability to copy and modify an out of the box workflow and (2) the custom task processes.

What I don’t love is the way SharePoint assigns names with spacing to these tasks that have “_X0028_” and “_X0029_copy” in it.  It can cause problems with importing the workflow into Visual Studio, referring to the content type in custom web parts, and as an architect, I just don’t like the way it looks too messy.  Plus, if I want to make changes to the task list or roll the task up in a web part, I don’t want to have to guess which task goes with which workflow.

Here is an example of what SPD does when it adds a custom task action to a workflow or when you copy out of the box (OOB) workflow:

SharePoint Designer 2010 Workflow - Custom Content Types

SharePoint Designer 2010 Workflow – Custom Content Types

And this is what I want it to look like:

SharePoint Designer 2010 Workflow - Custom Content Type Desired Name

SharePoint Designer 2010 Workflow – Custom Content Type Desired Name

And it’s not just aesthetics; I have certain fields that I want to be able to store in the task.  I know that I can assign them in the workflow task process, but I don’t want the end user to see them so I want them hidden.

Here are the steps:

  1. Create your custom content type at your parent site (or content hub).
  • Important note:  If you are going to be exporting your workflows to other environment (i.e. local to production) and you do not use a content type hub, I STRONGLY recommend creating these content types and any site columns associated with the workflow with code.  This will ensure that your GUID’s (custom ID’s) are the same across all environments.

–   I worked with a developer to create my site columns and content types for me since we are moving workflows across environments

–   If you do not have access to a developer, then you will need to replicate these steps in each environment to make sure the ID’s are correct for each.

  1. Optional Step: If you want the “Claim Task”, Custom Outcomes functionality, and the ability to Reassign or Request Changes that comes with the out of the box workflow tasks for Enterprise SharePoint, you will need to change the display and edit forms.  If not, you can skip this step.

Example of InfoPath display form vs .aspx display form

SharePoint Designer 2010 Workflow - InfoPath Form vs .aspx form

SharePoint Designer 2010 Workflow – InfoPath Form vs .aspx form

  • If you create the content type in Code, make sure the display and edit form properties include “_layouts/WrkTaskIP.aspx”
  • If you create the content type by hand (or did not assign a display/edit form specification in the code), open the content type in Designer and change the display and edit form to “_layouts/WrkTaskIP.aspx” under “Forms” on the right side of the screen.
SharePoint Designer 2010 Workflow - Forms

SharePoint Designer 2010 Workflow – Forms

  1. Create your workflow
  • Either Copy and Modify an out of the box workflow
  • OR Create a new workflow and add a custom task process – Start Approval Process, Start Custom Task Process or Start Feedback Process

–   (I have not tested this with the other task actions)

SharePoint Designer 2010 Workflow - Task Processes

SharePoint Designer 2010 Workflow – Task Processes

 

  1. Save the workflow, but do not publish it.
  • NOTE: If you have published it and have the odd-named content type, just delete that task form.  We will generate a new task form at the end.

–   This odd-named content type will exist in your Content types library until you delete it from there

  1. Open the custom content type you created in Designer and Copy the ID
SharePoint Designer 2010 Workflow - Task Content Type ID

SharePoint Designer 2010 Workflow – Task Content Type ID

 

  1. Go to All Files, Workflows, <WorkflowName> folder
  • Note: If the “All Files” folder looks empty, click on another folder, such as subsites, and select “All Files” again.
SharePoint Designer 2010 Workflow - Workflow Files

SharePoint Designer 2010 Workflow – Workflow Files

 

  1. Open the file that ends in  “.wfconfig.xml” and replace the following items:
  • Line 2: TaskContentType=”<ID>” with your custom content type
  • Line 4: ContentType Name=”<Name>” with your custom content type name
  • Line 4: ContentTypeID  = “<ID>” with your content type ID you copied from previous step
  • Line 4: WorkflowForm= “Workflows/<workflowname>/<contenttypename.xsn>” with your content type name (just the name of the form, leave the folder name as is)
SharePoint Designer 2010 Workflow - Replace Content Type Code

SharePoint Designer 2010 Workflow – Replace Content Type Code

Here is what it should look like (my content type is “IntakeReviewTask”)

SharePoint Designer 2010 Workflow - Replace Content Type Code

SharePoint Designer 2010 Workflow – Replace Content Type Code Result

*Line 2 not pictured

  1. Save the the xml file and go back to your workflow folder

 

  1. Hover over the file that ends in “.xoml” file and select “Open with”  -> “2. SharePoint Designer (Open as XML)”.

    SharePoint Designer 2010 Workflow - Open as XML

    SharePoint Designer 2010 Workflow – Open as XML

 

  1. Click (Ctrl+F) for Find and enter “ContentType” in the “Find what” box
SharePoint Designer 2010 Workflow - Find and Replace

SharePoint Designer 2010 Workflow – Find and Replace

  1. Replace the ContentTypeID=”ID” with your custom content ID

 

  1. CLOSE SharePoint Designer and re-open it.
  • Refreshing has not worked for me.
  1. Open Designer, open your workflow by clicking on “Workflows” and Save your file.   Click “No” if you receive any messages to replace your file.
SharePoint Designer 2010 Workflow - Do Not Replace

SharePoint Designer 2010 Workflow – Do Not Replace

 

  1. Publish your workflow.  The right side of the picture below shows my workflow after completing this process.
SharePoint Designer 2010 Workflow - Replaced Content Type

SharePoint Designer 2010 Workflow – Replaced Content Type

And Voila, no more messy names and you can use your custom content type for whatever you may need, displayed in a CQWP, for example.

Archive: Use “Check Out” and “Check In” actions with globally reusable workflows in SharePoint Designer 2010

This article was originally written in December 2011.  It is being reposted here as an archive.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I love that SharePoint Designer gives you the ability to create reusable workflows.  It’s even better that you can select “All” as the content type.   However, I have come across a minor issue with being able to update an item that requires check in and check out via workflow and being able to apply that to “any” list, content type, page or document.  You can’t start a workflow on an item that’s checked out, but you can’t update an item that’s checked in.  When you try to use the “Check out” action, you are expected to select a list to check out an item from.

The Requirement:  Create a workflow that will make field updates to a document or page that requires check-in / check-out.  This workflow must be able to work on any page or document library in the site collection.

The Problem:

  1. I can’t update any old field on a checked-in item housed in a library where check-out is required.
  2. SharePoint Designer workflow action “Check out item” wants me to choose a List Item to check out, but I need to be able to use this on any list or content type.
SharePoint Designer 2010 - Check Item Out

SharePoint Designer 2010 – Check Item Out

The Solution: a modification to the .xoml file that tells the workflow to use “this item” regardless of the list.

Disclaimer:  If you want to model an out of the box workflow, always copy and modify…it is never a good idea to modify the out of the box global workflows directly.

Steps:

  1. Set up your workflow with placeholders for your check-in and check-out actions.
  2. Add “Check out item in this list” and “Check in item in this list with Comment” actions to the appropriate steps on your workflow.
  3. Do not select a List.  Leave the “this list” as is.
  4. Save your workflow.
  5. Go “All Files”, “Workflows”, click on the workflow name in the window below “All files” so that your workflow displays it’s files in the window on the right side of the screen.
SharePoint Designer 2010 - Find Workflow Files

SharePoint Designer 2010 – Find Workflow Files

  1. Right click on the .xoml file and click “Open With”, “SharePoint Designer (open as XML)”
SharePoint Designer 2010 Workflow - Open File as XML

SharePoint Designer 2010 Workflow – Open File as XML

  1. Click Ctrl+F to find “CheckOutItemActivity”
  2. In that row you will see:  ListItem={x:Null}” ListID=”{x:Null}”
  3. Replace “x:Null” in “ListItem=” with “ActivityBind ROOT, Path=__item”
  4. Replace “x:Null” in “ListId=” with ActivityBindROOT, Path=__list”
  5. Click “Ctrl+F” to find “CheckInItemActivity”
  6. Repeat steps 8 and 9 for this line item.
SharePoint Designer 2010 Workflow - Replace Check In/Check Out Code

SharePoint Designer 2010 Workflow – Replace Check In/Check Out Code

  1. Save this file.
  2. Click on “Workflows” and click on the workflow name to open the workflow file as you normally would.
  3. Do not make any changes but click “Save”
  4. When Designer pops up to say that a different version of the .xoml file was saved, and politely asks if you want to replace that file with this one click “No”.
  5. Close Designer and re-open it
  6. Click on “Workflows” and click on your workflow to open and edit it.
  7. Find the step where you checked out and checked in the item.
  8. The action should say “Check out item in Current Item” and “Check in item in Current Item with comment: xxx”
SharePoint Designer 2010 Workflow - Replace Check In Check Out Code Results

SharePoint Designer 2010 Workflow – Replace Check In Check Out Code Results

I’m not sure why you have to close Designer and re-open it before you can see your changes, maybe it’s just my wonky machine, but I have to follow these steps exactly on order for the change to “take”.

 

Notes:

  • Make sure that you do NOT have “end on change” feature turned on, or your workflow will stop immediately after making the change without checking the document  back in.