| type="text/javascript"> | | | | about this a bit later, but for now, just follow the |
| This article was originally posted on | | | | instructions, look at the screenshots and make sure |
| Right, here is the first part of a three-part series on | | | | you get it right. If you end up with a different result, |
| automating business processes in SharePoint. We will | | | | delete the wrong fields and try again. In the Create |
| explore three different methods of doing Business | | | | New List Item dialog click the Title field and then |
| Process Management, or BPM, using SharePoint and | | | | Modify. A new mini dialog appears, called Value |
| available tools. The scenario is a simple helpdesk | | | | Assignment. Next to the 'To this value' text box, click |
| application in which users should be able to send | | | | the fx button to set the field title to a lookup field. |
| emails and have an issue be raised and sent to an | | | | Yet another mini dialog appears. Make sure you select |
| appropriate agent for resolution. We will use an email | | | | Current item and in the Field, select E-Mail Subject. |
| enabled list to receive emails and then use automated | | | | Here's a screenshot: Ok, so what is actually going on |
| processes to route that email into the issue tracking | | | | here? The process is important but may be confusing |
| system. The system will make sure that the issue is | | | | the first time you see it, especially the lookup fields in |
| tracked and escalated as appropriate. A few things | | | | step 3. Now, the following paragraphs will go into |
| worth noticing. This series will not result in a | | | | some rather deep and perhaps confusing detail on |
| production ready system. It is meant to show | | | | how the dialogs work. I will explain as best I can, but |
| different aspects of process automation, not to | | | | if you feel you are in over your head, just skip to |
| create the best method of doing a specific task such | | | | the final steps of setting up this workflow. Value |
| as creating a help desk application. The series is | | | | assignment dialog First of all we decide we want to |
| meant to show the entire process of creating the | | | | set a field, in this case on an item. In step 2, also a |
| application. First of all, lets draw a simple diagram to | | | | common dialog in SPD, we basically have two options |
| explain how the system is supposed to work. So, in a | | | | to setting a text field. The [...] button lets us set the |
| few short sentences: 1. Receive a new email and | | | | value of a field to a text that you type in. The [fx] |
| start a new support issue (handled by SharePoint | | | | button lets us set the value of field by looking up |
| designer) 2. Escalate issue and find an available | | | | another field in the site. Before we look at what |
| operative to handle the case (handled by an event | | | | goes 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 step | | | | text box, but for a date/time field you get a |
| 2. (handled by a custom workflow in Visual Studio) If | | | | calendar, 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 is | | | | a person in several different places, including the |
| demonstrating different aspects of business process | | | | address book and SharePoint users. I have included |
| management, not doing a best practice thing. In a | | | | some screen shots below. Ok, so we can set fields |
| production system you would likely want to do all of | | | | of our list item to a set value which is useful in a |
| this in a state machine workflow, or at least not do | | | | range of scenarios. What we want to do in our case, |
| three different approaches to automation in one | | | | though, 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 probably | | | | with the incoming email. Define Workflow Lookup |
| know, or will learn in about one second, SharePoint | | | | dialog In step 3 of setting the value of the title field |
| lists can receive email. This means that when | | | | we got the Define Workflow Lookup dialog when we |
| someone sends an email to a certain address in the | | | | clicked the [fx] button. The dialog can be a bit |
| domain you set up, the email will be sent to a list | | | | confusing as well, but after a few paragraphs, things |
| which will then receive a new item containing that | | | | should 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, meaning | | | | SharePoint site to use to set the value of a field. |
| that if you want to have one system to handle | | | | There are basically two fields in the dialog, which item |
| multiple addresses you need to work around that and | | | | from which to use a value and what value of that |
| at the very least have multiple lists. We shall look at | | | | item should be used. For our example it was rather |
| one option for doing this with a SharePoint Designer | | | | simple. Remember that the workflow is initiated by |
| Workflow. Also, only a certain number of list types | | | | the item in the email enabled receiver list. thus, what |
| can receive email, and sadly Custom lists are not on | | | | is listed in the lookup dialog as 'Current item' is actually |
| that list. The reason you cannot send email to a | | | | the item in the receiver list, not the item you are |
| custom SharePoint list is that to enable email you | | | | currently creating. Important distinction. What makes |
| need a very specific set up fields and properties set | | | | the workflow lookup dialog a bit more complex is |
| on the list. If there is public outcry for this I can | | | | that you can work not only with the current item, |
| create a new article later showing how to create a | | | | but with any item in your site. Look at the screen |
| custom email enabled lists using features. Use for | | | | shot below. As you can see we can work with but |
| your requests, as usual. Before we actually look at | | | | the 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 email | | | | If you select any list directly, i.e. not current item or |
| enabled list. I will not go through setting this up. Email | | | | workflow data, the workflow lookup changes to let |
| setup is a complex thing and we would be spending | | | | you set up how you will find the relevant item in the |
| the entire day just setting up email, and most likely it | | | | lookup list. The new section of the dialog allows you |
| would not be usable in your scenario anyway. At this | | | | to select which field you will use to find the new |
| point I will assume that you have set up an email | | | | item. ID is often a good choice since it is unique for |
| enabled list and have that working. If you do not, I | | | | each 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 likely | | | | new 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 lists | | | | lookups across several lists. It can be really powerful |
| be email enabled? Well, that does not prevent us | | | | but 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 create | | | | have set up the title field properly, here's the good |
| an issue, and we might as well do that in a custom | | | | news. Do the same to the Message and Sender |
| list. So, go ahead and create a few lists. We need | | | | fields, mapping to the fields 'Body' and 'E-mail From' of |
| one list to hold our incoming emails that will be email | | | | the current item, and we are done. Depending on |
| enabled. I use an announcement list since it is fairly | | | | where you are at the moment, click back to the |
| basic. Any basic announcement list will do. Email enable | | | | Create New List Item dialog, where, at present, you |
| it in list settings and give it a useful email alias. I call | | | | should have configured the title field. To add more |
| my announcement list 'support-receive' use | | | | fields to the new item, click Add. Select the field you |
| support@lab-s02 as the email alias. You will likely use | | | | want to set (Message and Sender in order) and map |
| something else :-) Second, create a custom list that | | | | it to the correct field of the current item, as |
| will hold the issues. You need the following fields: title | | | | described in the last paragraph. Your final field setup |
| (single line text) message (multi line text) sender | | | | for the new item should look something like this: |
| (single line text) We shall expand this list in both the | | | | That's it! We have create a new SharePoint Designer |
| next articles in the series, but for now this will be | | | | workflow. Just hit Ok and then Finish and SharePoint |
| enough. I have called my list 'Issues'. Use whatever | | | | Designer will go off and do some configuration magic |
| name you like. Ok, we should be ready to start | | | | to attach the workflow to your list. Testing Now |
| working with the actual workflow. SharePoint | | | | that you have your workflow set up, go ahead and |
| Designer workflow Right, start SharePoint Designer | | | | test it by sending an email to your list. If you have |
| and connect to your site. Click File->New and select | | | | your email enabled list set up properly you should get |
| the SharePoint Content tab. Select Workflow in the | | | | a new item in the receiving list. Open the list in the |
| left pane and Blank workflow (only option) in the | | | | web interface. When the item arrives, and it make |
| right pane. Next, click Ok to start the Workflow | | | | take a minute or two, go ahead and click the item or |
| Designer wizard. On the first screen of the Workflow | | | | open its context menu to find the Workflows |
| Designer you only need to give your workflow a | | | | available to that item. You should find your workflow |
| descriptive name and make sure you attach the | | | | under the 'Start a New Workflow' section. Click it and |
| workflow to the email enabled list (support-receive in | | | | verify that it actually creates a new item in your |
| my case). You can leave the option to manually start | | | | Issues list. More fun stuff! Since we are using a |
| the workflow. This means that when you want to | | | | receiver list to pipe our incoming email into an issues |
| start the workflow you do so manually by either | | | | list we can surely use different receiver lists as well. |
| opening the context menu on the item in the list or | | | | Let's up the complexity a bit. We can now use two |
| on the display form of the item. If you like you can | | | | email enable lists, say one called support-receive and |
| also set the workflow to start automatically, when | | | | one 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 you | | | | well as to the same issue list. However, we have no |
| leave it off at the moment. Your window should look | | | | method of differentiating the issues at present. So, in |
| something along the lines of this: Click Next to get to | | | | order 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 basically | | | | Choice 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 that | | | | enabled lists. Oh, and one thing. You may want to |
| you probably do not want to develop a workflow like | | | | make this field a site column rather than just a list |
| this in a production environment. I mean, there will be | | | | column. 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 a | | | | folder list, then open your workflow and then |
| descriptive name for this step, for instance 'Create | | | | double-click the xoml file to open the Workflow |
| issue item'. Next, click the Actions button and find | | | | Designer again. Note that you can click the Back |
| Create a list item. Note that the list of available | | | | button to change how the workflow is started, but |
| actions may be different in your case. The list is | | | | you 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 even | | | | the text 'Create item in Issues'. this will reopen the |
| more workflow actions that you can perform, and, if | | | | Create New List Item dialog. Click to add a new field. |
| you are up for some coding, you can also create | | | | You choices field 'Issue Type' should be there now. |
| your own actions that will appear in the list. But that's | | | | Since you are working on the support-receive list, |
| another show. Right. When you select Create List | | | | select to set the field to Support. See screenshot for |
| Item you will see that you get a text like in the | | | | how it looks on my machine. Great. Now, new items |
| screenshot below. This text, and similar texts for | | | | sent to the support-receive will be marked as being |
| other workflow tasks, are used to configure the | | | | of type Support. Repeat the entire process of |
| specific task. In our case we need to configure what | | | | creating the workflow for your invoice-receive list as |
| item will be created and where. To do so, click the | | | | well, 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 configure | | | | and suddenly you have not only a way to receive |
| the item that will be created. We want to create a | | | | emails 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 new | | | | this may not have been incredibly impressive, but this |
| item. Any required fields in the list you select will | | | | is the start of some really cool stuff you can do. We |
| automatically be populated for you, meaning at least | | | | shall explore this a bit further in the next article |
| Title and possibly others as well, depending on which | | | | where we go into some more advanced things we |
| fields are required. Ok, now things get a bit hairy, but | | | | can do with SPD and then head down into another |
| the following steps and dialogs are about as | | | | cool aspect of business process automation: Event |
| important to workflows in SharePoint Designer as | | | | receivers. |
| breathing every few seconds. I will explain more | | | | |