Automatic business processes in SharePoint (part 1 of 3): SharePoint Designer Workflows

type="text/javascript">about this a bit later, but for now, just follow the
This article was originally posted oninstructions, look at the screenshots and make sure
Right, here is the first part of a three-part series onyou get it right. If you end up with a different result,
automating business processes in SharePoint. We willdelete the wrong fields and try again. In the Create
explore three different methods of doing BusinessNew List Item dialog click the Title field and then
Process Management, or BPM, using SharePoint andModify. A new mini dialog appears, called Value
available tools. The scenario is a simple helpdeskAssignment. Next to the 'To this value' text box, click
application in which users should be able to sendthe fx button to set the field title to a lookup field.
emails and have an issue be raised and sent to anYet another mini dialog appears. Make sure you select
appropriate agent for resolution. We will use an emailCurrent item and in the Field, select E-Mail Subject.
enabled list to receive emails and then use automatedHere's a screenshot: Ok, so what is actually going on
processes to route that email into the issue trackinghere? The process is important but may be confusing
system. The system will make sure that the issue isthe first time you see it, especially the lookup fields in
tracked and escalated as appropriate. A few thingsstep 3. Now, the following paragraphs will go into
worth noticing. This series will not result in asome rather deep and perhaps confusing detail on
production ready system. It is meant to showhow the dialogs work. I will explain as best I can, but
different aspects of process automation, not toif you feel you are in over your head, just skip to
create the best method of doing a specific task suchthe final steps of setting up this workflow. Value
as creating a help desk application. The series isassignment dialog First of all we decide we want to
meant to show the entire process of creating theset a field, in this case on an item. In step 2, also a
application. First of all, lets draw a simple diagram tocommon dialog in SPD, we basically have two options
explain how the system is supposed to work. So, in ato setting a text field. The [...] button lets us set the
few short sentences: 1. Receive a new email andvalue of a field to a text that you type in. The [fx]
start a new support issue (handled by SharePointbutton lets us set the value of field by looking up
designer) 2. Escalate issue and find an availableanother field in the site. Before we look at what
operative to handle the case (handled by an eventgoes on there, though, note that different field types
receiver) 3. Update the issue, and if it is resolved,yield different input options. For text field you get a
send a message to the customer. If not, go to steptext box, but for a date/time field you get a
2. (handled by a custom workflow in Visual Studio) Ifcalendar, while for a Yes/No field you get a
you are going to do this in a production environment,drop-down and for a person field you get to look up
don't. Basically what we are doing here isa person in several different places, including the
demonstrating different aspects of business processaddress book and SharePoint users. I have included
management, not doing a best practice thing. In asome screen shots below. Ok, so we can set fields
production system you would likely want to do all ofof our list item to a set value which is useful in a
this in a state machine workflow, or at least not dorange of scenarios. What we want to do in our case,
three different approaches to automation in onethough, is to set different fields to the values of
single system. Let's get started with lesson one.another object, namely the item that was created
Solution walkthrough Setup Now, as you probablywith the incoming email. Define Workflow Lookup
know, or will learn in about one second, SharePointdialog In step 3 of setting the value of the title field
lists can receive email. This means that whenwe got the Define Workflow Lookup dialog when we
someone sends an email to a certain address in theclicked the [fx] button. The dialog can be a bit
domain you set up, the email will be sent to a listconfusing as well, but after a few paragraphs, things
which will then receive a new item containing thatshould be as clear as... something really clear. The
email. There are problems, though, or at least quirks.lookup dialog allows you to find other items in the
Each list can only have one email address, meaningSharePoint site to use to set the value of a field.
that if you want to have one system to handleThere are basically two fields in the dialog, which item
multiple addresses you need to work around that andfrom which to use a value and what value of that
at the very least have multiple lists. We shall look atitem should be used. For our example it was rather
one option for doing this with a SharePoint Designersimple. Remember that the workflow is initiated by
Workflow. Also, only a certain number of list typesthe item in the email enabled receiver list. thus, what
can receive email, and sadly Custom lists are not onis listed in the lookup dialog as 'Current item' is actually
that list. The reason you cannot send email to athe item in the receiver list, not the item you are
custom SharePoint list is that to enable email youcurrently creating. Important distinction. What makes
need a very specific set up fields and properties setthe workflow lookup dialog a bit more complex is
on the list. If there is public outcry for this I canthat you can work not only with the current item,
create a new article later showing how to create abut with any item in your site. Look at the screen
custom email enabled lists using features. Use forshot below. As you can see we can work with but
your requests, as usual. Before we actually look atthe current item, something called Workflow data,
how this will be done, we need a few things set up.which we will cover later, as well as all lists in the site.
We want to receive email so we need an emailIf you select any list directly, i.e. not current item or
enabled list. I will not go through setting this up. Emailworkflow data, the workflow lookup changes to let
setup is a complex thing and we would be spendingyou set up how you will find the relevant item in the
the entire day just setting up email, and most likely itlookup list. The new section of the dialog allows you
would not be usable in your scenario anyway. At thisto select which field you will use to find the new
point I will assume that you have set up an emailitem. ID is often a good choice since it is unique for
enabled list and have that working. If you do not, Ieach item. However, you also need to select the
recommend Googling "email enable lists in sharepoint",value which the said field will have. And there you are
but be prepared to spend a little time setting this up.with the [fx] button again. Clicking that will yield a
Second, since we need to track issues, we likelynew Define Workflow Lookup dialog. Think it is
want to have a SharePoint list containing the issues.confusing? It is. At this point you are doing multi level
Remember we can only have certain types of listslookups across several lists. It can be really powerful
be email enabled? Well, that does not prevent usbut you need to wrap your head around it. Final
from creating a custom list to hold the actual issues.tasks Ok, back to non-head-exploding land. If you
After all, the first step in our automation is to createhave set up the title field properly, here's the good
an issue, and we might as well do that in a customnews. Do the same to the Message and Sender
list. So, go ahead and create a few lists. We needfields, mapping to the fields 'Body' and 'E-mail From' of
one list to hold our incoming emails that will be emailthe current item, and we are done. Depending on
enabled. I use an announcement list since it is fairlywhere you are at the moment, click back to the
basic. Any basic announcement list will do. Email enableCreate New List Item dialog, where, at present, you
it in list settings and give it a useful email alias. I callshould have configured the title field. To add more
my announcement list 'support-receive' usefields to the new item, click Add. Select the field you
support@lab-s02 as the email alias. You will likely usewant to set (Message and Sender in order) and map
something else :-) Second, create a custom list thatit to the correct field of the current item, as
will hold the issues. You need the following fields: titledescribed in the last paragraph. Your final field setup
(single line text) message (multi line text) senderfor the new item should look something like this:
(single line text) We shall expand this list in both theThat's it! We have create a new SharePoint Designer
next articles in the series, but for now this will beworkflow. Just hit Ok and then Finish and SharePoint
enough. I have called my list 'Issues'. Use whateverDesigner will go off and do some configuration magic
name you like. Ok, we should be ready to startto attach the workflow to your list. Testing Now
working with the actual workflow. SharePointthat you have your workflow set up, go ahead and
Designer workflow Right, start SharePoint Designertest it by sending an email to your list. If you have
and connect to your site. Click File->New and selectyour email enabled list set up properly you should get
the SharePoint Content tab. Select Workflow in thea new item in the receiving list. Open the list in the
left pane and Blank workflow (only option) in theweb interface. When the item arrives, and it make
right pane. Next, click Ok to start the Workflowtake a minute or two, go ahead and click the item or
Designer wizard. On the first screen of the Workflowopen its context menu to find the Workflows
Designer you only need to give your workflow aavailable to that item. You should find your workflow
descriptive name and make sure you attach theunder the 'Start a New Workflow' section. Click it and
workflow to the email enabled list (support-receive inverify that it actually creates a new item in your
my case). You can leave the option to manually startIssues list. More fun stuff! Since we are using a
the workflow. This means that when you want toreceiver list to pipe our incoming email into an issues
start the workflow you do so manually by eitherlist we can surely use different receiver lists as well.
opening the context menu on the item in the list orLet's up the complexity a bit. We can now use two
on the display form of the item. If you like you canemail enable lists, say one called support-receive and
also set the workflow to start automatically, whenone called invoice-receive. Each can have a different
an item is added and/or when an item is changed.email alias making it possible to pipe for instance as
You can modify this setting later so I suggest youwell as to the same issue list. However, we have no
leave it off at the moment. Your window should lookmethod of differentiating the issues at present. So, in
something along the lines of this: Click Next to get toorder to do this, add a new field to your issues list in
the second page of the Workflow Designer wizard.SharePoint called 'Issue Type'. The field will be a
Don't worry, we a soon done :-) We are basicallyChoice field and the choices will be 'Support' and
only going to do one thing here, at least in the first'Invoice'. You can add more if you have more email
implementation, which again illustrates the point thatenabled lists. Oh, and one thing. You may want to
you probably do not want to develop a workflow likemake this field a site column rather than just a list
this in a production environment. I mean, there will becolumn. You will see why in the next article. Go back
only one task performed, so hardly any 'flow'.to SharePoint designer and modify your workflow.
However, Windows Work Foundation sounds lame.To do this, open the Workflows tree node in the
But I digress. One task to perform. First, write afolder list, then open your workflow and then
descriptive name for this step, for instance 'Createdouble-click the xoml file to open the Workflow
issue item'. Next, click the Actions button and findDesigner again. Note that you can click the Back
Create a list item. Note that the list of availablebutton to change how the workflow is started, but
actions may be different in your case. The list isyou cannot change the list to which it is associated.
dynamic and lists your most recent actions on top.Back on the second step of the wizard, the one with
Note also that you have a 'More actions...' option at'Conditions' and 'Actions', click on the 'Issues' link in
the bottom. You can use that option to see eventhe text 'Create item in Issues'. this will reopen the
more workflow actions that you can perform, and, ifCreate New List Item dialog. Click to add a new field.
you are up for some coding, you can also createYou choices field 'Issue Type' should be there now.
your own actions that will appear in the list. But that'sSince you are working on the support-receive list,
another show. Right. When you select Create Listselect to set the field to Support. See screenshot for
Item you will see that you get a text like in thehow it looks on my machine. Great. Now, new items
screenshot below. This text, and similar texts forsent to the support-receive will be marked as being
other workflow tasks, are used to configure theof type Support. Repeat the entire process of
specific task. In our case we need to configure whatcreating the workflow for your invoice-receive list as
item will be created and where. To do so, click thewell, but change the value of the issue type to
'this list' link in the text next to the actions button.'Invoice'. Repeat for any other receiving lists as well,
Now, in the dialog that opens you get to configureand suddenly you have not only a way to receive
the item that will be created. We want to create aemails to multiple addresses, but the beginning of a
new issue so make sure your issues list is selected.simple classification system as well. Ending it all Ok, so
Next, you need to configure the fields of the newthis may not have been incredibly impressive, but this
item. Any required fields in the list you select willis the start of some really cool stuff you can do. We
automatically be populated for you, meaning at leastshall explore this a bit further in the next article
Title and possibly others as well, depending on whichwhere we go into some more advanced things we
fields are required. Ok, now things get a bit hairy, butcan do with SPD and then head down into another
the following steps and dialogs are about ascool aspect of business process automation: Event
important to workflows in SharePoint Designer asreceivers.
breathing every few seconds. I will explain more