SharePoint 2013: Create Reusable Workflow on Content Type using SharePoint Designer 2013
Introduction
This article describes how to create a Reusable workflow on Content Type using SharePoint Designer 2013. This workflow is created on SharePoint 2013 Platform.
Scenario
Reusable workflows are not created for specific list or library but as the name suggests, they can be associated to any list or library. Here we will be creating a reusable workflow on Content Type (CT) and this CT is used by multiple list or libraries. This allows our workflow to work for multiple list or libraries.
Create Content Type
First step is to create a content type and add some columns to it.
To create CT, navigate to Site Settings -> Content Types (under Web Designer Galleries) -> Click Create.
Provide following details:
- Name Ex. ProjectContentType
- Select Parent Content Type Form Ex. List Content Types
- Parent Content Type Ex. Item
- Select Existing Group or Create New Group
Click OK.
Create Site Columns for Content Type
Once CT is created, click on “Add from new site column” link to add the below columns:
- Email (Person or Group)
- ProjectStatus (Choice with values – New, Assigned, Completed)
- ProjectComments (Multiple Line of Text)
Create List to use Content Type
Navigate to Site Contents -> Add an App -> Create two Custom List “Project1” and “Project2” (one by one)
Navigate to List -> List Settings -> Advanced Settings -> Change “Allow Management of Content Types” to “Yes” -> Click OK.
Under Content Types -> Click on “Add from existing site content types” -> Select your content type, click Add, then OK.
Click on “Change new button order and default content type” -> Change content type “Position From Top” to 1 (to set as default) -> Click OK
Create and Associate Reusable Workflow
Now follow below steps to create a simple workflow that based on status value updates "ProjectComments" field and associate this workflow to lists created in earlier steps.
Open site in SharePoint Designer 2013.
Select "Reusable Workflow" under "Workflows" and provide details:
- Name of the workflow
- Select CT from dropdown created in earlier steps
- Workflow Platform as "SharePoint 2013 Platform"
In the workflow, add an action "Set Field in Current Item" to update "ProjectComments" field with "ProjectStatus" field value.
Save and Publish the workflow.
From the top ribbon, select "Associate to List", all lists using CT (created in an earlier step) will be available here. Select list one by one to associate workflow.
On clicking list name, a page will open for "Add a Workflow", without doing any other change, provide a Name for the workflow and change Start Options as per your need. Click OK.
Repeat above step for the other list also.
Test your workflow.
References
- https://msdn.microsoft.com/en-us/library/office/jj163181(v=office.15).aspx
- https://msdn.microsoft.com/en-us/library/office/jj554671.aspx