A SharePoint Workflows tutorial by Peter Kalmström
In
the previous article we described how to create a
workflow that sends an e-mail alert to the person who was
called. That workflow only works for one list, but it
is possible to instead create a reusable workflow that can
be used with a Phone Message content type in the whole SharePoint
tenancy.
In the demo below Peter Kalmstrom, CEO and Systems Designer
of kalmstrom.com Business Solutions, shows how to create
a reusable workflow. The workflow is connected to a
Phone Message content type and sends an alert to the
person how has a phone message.
As Peter showed a more elaborate alert e-mail in the earlier
demonstration, he just creates a simple e-mail this time.
Instead this demo focus on the re-usability of the workflow.
The workflow has to be a SharePoint 2010 workflow, as 2013
workflows cannot be connected to a specific content type.
Create a reusable workflow and connect it to a content
type
Open the Content Type Hub in SharePoint Designer
2013.
Click on Workflows in the left panel.
Click on the Reusable Workflow button in the ribbon.
Give the workflow a name.
Select to create a SharePoint 2010 workflow .
Connect the workflow to your Phone Message content
type and click OK.
Click on the Action button in the ribbon and select
the Action 'Send an Email'.
Click on 'these users' and select a Workflow Lookup
for a User .
Select the 'Called' field from source and the Return
field 'Email Address'.
Enter a subject and a body text for the e-mail.
Peter adds a Lookup for Name in the subject. In the
body he adds a lookup for the Phone number.
Publish the workflow.
Now this workflow will be used in all lists that use the
phone messages content type in that site collection.
Create a workflow template for other site collections
To use the same workflow in other site collections, you
can save it as a template and upload the templates file
to the other site collections.
Open the workflow settings again and click on the
Save as Template button in the ribbon. The workflow
will now be saved as a WSP file in the Site Assets library.
Open All Files in the left panel and select Site
Assets and then the reusable workflow you just saved.
View the reusable workflow in the browser and download
it to your PC.
Open the site settings in the root site of the site
collection where you want to use the workflow.
Click on 'Solutions' in the Web Designer Galleries
group.
Upload the WSP file and activate it to make it available
for the whole site collection.
Open the site settings again and click on the 'Manage
site features' link in the Site Actions group.
Activate the reusable workflow.
Associate the workflow with a list
To associate the workflow with the Phone Messages
list, open the List Settings and click on the Workflow
Settings link.
Click on 'Add a workflow' and select the content
type and then the workflow you want to add.
Give the workflow a unique name and select it to
be run when a new item is created.
Click on OK and then Activate.
In the
next article, we will have look at how you can add a
link to the current list item in edit mode to the e-mail
sent out by the workflow. With such a link the person who
gets the e-mail message can open the list item directly
from the e-mail and mark the call as returned.