Assign a Task is one of the most powerful actions available in SharePoint Designer. There were enough tips to break it into its own post. See below for more posts in this series.
Consider Using Configuration List for Roles
- Can be used to map Roles to People (person type) or email (string type) so that if a person permanently or temporarily (vacation, sabbatical, etc.) needs to act on tasks of a specific type, you do not need to republish the workflow to change hard-wired task assignees.
- Set a variable, e.g. Version, to the v 1.00 (or whatever) | Workflow Context - Workflow Association name(CurrentItem:Id).
- Consider adding today's date to the version variable so that you know when that instance of the workflow started.
- I also include whether the workflow considers the current item a [test] item.
- Include version (a local variable you set in the first stage of the workflow) and workflow association name in super small font in task emails. If a workflow is republished with new functionality, workflows already running continue to use the old code. Including the version lets you differentiate which version generated that email when people complain that a typo is still in the email e.g.
- Increment the version as needed.
Create Custom Workflow 2013 "Done" Task Content Type
If you don't care about the outcome of a task (like the OOTB Approved / Rejected), follow these steps to create a task which has a "Done" button. Clicking on this button sets the Task Status to complete and % Complete to 100% and making the workflow consider the task done.
Create the Site Column
- Site Settings > Web Designer Galleries - Site Columns > Create
- I chose "Outcome" for my name, but maybe DoneOutcome would have been a better, more specific choice.
- Type of Information is "Task Outcome".
I recommend creating a group with a "." prefix which puts all your groups of custom content types at the top of a couple of handy places.
- Any choices entered into the "Type each choice on a separate line:" text box generates a separate button on the Edit view of the task. Enter a single choice of "Done".
Create the Site Content Type
Add the Site Content Type to the Workflow Task List
- Determine or set the task list for your workflow from SharePoint Designer.
- In the web UI, go to Task List > Settings
- The Task content type should already be in the Content Types list. Click "Add from existing site content types" and add the new "Simple Workflow Task" or whatever you named your content type.
Create a Workflow task with Done button in SharePoint Designer 2013
Allow Comments in Custom Workflow 2013 Task Content Type
This allows the user to add a comment about why they chose Approved or Rejected which can then be used to inform others from a workflow.
Important tip: only direct descendants of the "Workflow Task (SharePoint 2013)" are available in the Assign a Task activity. Grandchildren are not shown as options.
Create the Site Content Type
- Site Settings > Web Designer Galleries - Content Types > Create
- Name: Approval with Comment (or whatever your preference is)
- Parent content type – List Content Types > Workflow Task (SharePoint 2013)
- Choose your custom group, "." prefix recommended as noted above.
- At the bottom of the columns, select "Add from existing site columns" > Add "Comments" > Ok
Using the Comments in SharePoint Designer 2013
- Add the Site Content Type to the Workflow Task List as noted above.
- In an Assign a Task activity, choose the new Task content type:
- Grab TaskID returned from the "Assign a Task" activity. This contains the GUID of the task item, not its list ID.
- After the task has been completed in the workflow, here is how to get the comments using the TaskID, especially useful in an outcome notification email.
Give Explicit Instructions in the Task Creation email editor
- I like to include Step 1 edit the related item (or whatever) and step 2, click on the task, edit the task, click Done (or Approved, etc.).
- Despite knowing to whom the email will be sent (Task Assignee), using their role in the email salutation is better so that the recipient has context, especially if they perform multiple roles, e.g.
- If a person will get many tasks for similar items, include multiple fields in the task name to differentiate them in his task list if possible.
Part 2 of a 3-Part Series of Workflows Tips
I have written most of the following posts which should be ready by end of 2018. I intend to include the links below:
- General SharePoint Designer 2013 Workflow Tips
- Workflow Task Tips (this post)
- Working with REST in SharePoint Workflow