Ready to watch this entire course?
Become a member and get unlimited access to the entire skills library of over 4,987 courses, including more IT and personalized recommendations.Start Your Free Trial Now
- View Offline
You can create your own workflows without code by using SharePoint Designer 2010. SharePoint Designer 2010 is a free download from Microsoft. Once it's installed, you can open it up and tell it to connect to a particular SharePoint site. So I'm going to open an existing site, and I'm going to give it the address of a team site that I have and click Open. SharePoint Designer is really used for several different reasons. Changing the look of SharePoint sites, creating custom pages and custom data connections, but a big piece of it is the idea of creating custom Workflows.
Now if you notice, on the left-hand side, we basically have a breakdown of what the site is made of. Our Lists and Libraries, for example, our Site Pages, and we have a section called Workflows. What it's telling me right now is the three SharePoint Workflows that are available out of the box. Again, this is if you have SharePoint Server. And also, if your administrator has made sure that these workflows are enabled, because they can be turned off. But I'm not interested in any of these. I'm actually interested in making a custom workflow for a custom situation.
I'm going to create a simple example of a problem that I might be having in this site. Let's say right now I have two document libraries. One called Shared Documents, which is kind of generic, and one called HR Policies. Perhaps the policy documents library has versioning on. It has a lot of content control. It might even have other workflows on it. It might have things like auditing and expiration. I'm worried because perhaps people have been uploading policy documents into the wrong place. So what I'm going to do is create a workflow on my Shared Documents library to check that any new document might not have the word Policy in it.
If it does, I'm going to move it to a different library. Again, this is a simple example, but it should show you the kind of way that we start to interact with SharePoint Designer. So going back into SharePoint Designer, I'm going to go into Workflows and create a new one. My choices up here are a List Workflow, which is specific to a particular list or library. Again, lists and libraries in SharePoint are really the same thing. Reusable Workflow, which can be applied to multiple lists and libraries, or a Site Workflow applying to the entire site.
I'm interested in the most common type, which is the List Workflow. This list workflow is going to be applied to my Shared Documents library. So I'll click that. It's going to ask me which lists does this apply to? Let's find Shared Documents. There we go and give it a name. I'm going to call it Check for Policies. So this workflow checks for documents that might be policies and moves them to the HR Policies document library. Click OK. Then what? Well, all workflows are a series of tasks and questions. So I can ask things about the documents.
I've got the message here, Step 1. What do we want to do? I can start typing, or it says use the Insert group and the Ribbon, which is this group up here. That means I can start off by performing some actions or I can check for some conditions. It's really up to you. Your actions might start off with sending e-mail. It might start off with logging a message to the Workflow History list. There is all sorts of things you could do here. I'm going to do a condition first. If I click this little drop down, it gives me a few fairly specific examples. Do I want to check if it's created by a specific person, or the oerson is a valid SharePoint user, or it has a certain file size, or the Title field contains certain keywords.
Well, that looks like a good one here. I'll go with title field contains keywords. That immediately drops in this entry for Step 1, and keywords is underlined because I need to click it to say what those keywords might be. I am going to say if the title field contains the word Policy. Well, then what? Well, on the next step, we can either perform an action or we could check something else. Well actually, here I've got a little bit of a problem, because if the title field contains the word Policy, it is actually case-sensitive here.
So I need to ask another If statement. Really, I'm going to check it again. I'm going to say and the title field contains keywords. Well, no, it's not an And. I want to click that to change it to Or, or the title field contains the word policy in lowercase. Now in fact the thing to be aware of here is that when you upload a document to a document library, you both have a title field and you have a name field. The name field is the actual filename by default. So if you're filename is expensespolicy.doc, that would be the name, not the title.
So I need to think a little more about this and then I need to actually check for something else. So I'm going to ask another condition. I'm going to my conditions here. If I look down here, I don't have the idea that the name field contains a certain keyword. But up here, I've got a bit more generic ones. If the current item field equals value. What I mean by here if some field in the current item, meaning the item that caused the workflow to happen, equals some value. That's actually what I want. It looks a little generic, but there are a lot of things you're going to pick this option for.
So I will select that, and it's going to say and field equals value. Well, no, it's another Or situation here. But it doesn't know what I'm talking about here. Well the field, what field could I be using? Or when I click that, it gives me all of the fields that this current item has, Approval Status, Check In, Comment, Content Type. Who it was created by. What the URL is. As I keep coming down, we've got Name. That's the one I'm interested in. Or the Name equals -- well, it's not an equals as I want again. I'm going to click that.
You've got all these options. There is not equal to, begins with, ends with, and does not end with. Contains is what I want. That will work there. One last condition just to work on my case sensitivity here, same kind of thing. Or the current item name contains the word policy in lowercase. So bit of a long-winded condition, but gives you the idea of how I would start to string some of these together. The question is then, what do I want to do? Well, what I'd like to do is actually move the current item, whatever it is that caused this workflow to happen, move it to another location.
So I'm going to click on this entry here. It'll say start typing. Let's say I start the word move. Well, it doesn't seem to have any results there. So maybe that's not what I'm looking for. How else might I look? Well, I'm going to delete that, and instead of typing something in, I'm going to use this Action drop-down, which gives me all the possible things I can do. Do I want to add a comment? No. Do a calculation? No, I don't want to do that. Send an email? Well, maybe but in a moment. Send a document to a repository.
No, don't want to do that either. Check something in, check it out, and copy it. Okay, but it doesn't look like there is a move, but there looks like there is a copy. That looks like there is a delete. So I could do a bit of a combination there. Sometimes you'll find that in SharePoint Designer that you have to be a bit thoughtful about what you're trying to do. So there isn't a Move option, but there is a Copy and a Delete option. If I look down a little further, we've got a whole bunch of other things that we could do, but I'm going to pick that one. Copy the list item, and it's just going to say Copy item in this list.
Well, what do we want to copy? The default is the current item. Yes, that's what I want, but you could copy something else. Where is the location? Well, I want to take it from my Shared Documents library and put it in my HR Policies library. Okay, it looks good. We've got the item now copied, but that's not everything. I still want to go a bit further. So underneath there, I'm going to actually do something else. Again, I could pick it up from the drop-down here, or if I wanted to I could start typing.
I think there was something with the word delete. As I start typing here, it seems to say yup, there is 3 results with the word delete. Press Enter to view. So I'll hit that. Delete Drafts, Delete Item, Delete Previous Versions. I want to delete the item. You might be thinking, well, you just copied it. So, which one you'll be deleting? Well, I want to delete the current item, because I copied it to someone else. I want to delete the original one. Then finally, what I'm going to do, clicking underneath it, and be careful where you click to make sure you're in the right place.
I'm going to send an e-mail. So I type in send, Send an E-mail. Yup, because I'd like to point out to whoever just uploaded that document they're not meant to do that. So e-mail these users. I'll click the link of these users, and it says will who's these to? Well, of course, right now I don't know who it's to. It could be a whole bunch of different people would be moving and uploading documents. So I can't type an explicit e-mail address, unless I just wanted to notify a specific person. But by clicking the little address book, I can see I've got a whole bunch of options here.
Is it the administrator, is it the system account, is it the people and the Owners group or the Members group or the Visitors group? Oh, but we have a pretty interesting one here, the user who created the current item. Fine. I don't need to know exactly who it is, because whoever cause this workflow to be kicked off, it's going to be sent to them. I could CC somebody else in particular. So I'm going to type in the subject here. Don't upload policy documents to Shared Documents! I could just give them a quick message.
So I give them just a quick message here. But let's say they just uploaded 10 documents. They can't remember which one they did where. I might give them a little hint. So I'd like to say you uploaded a policy document, and tell them which one it was. The thing that I can do is click in that position, so you uploaded a policy document and I'll give them the name of the document. I'm going to click this little button here called Add or Change Lookup. That's going to inject some options into our page. It is going to say okay, we're bringing from the current item. Yes, we are. What field were we interested in? Well, the default one or the best one here would be in the name field, because that will be the name of the document file itself.
Click OK and I'm going to click OK. A very commonly here too, what you'd also want to do in a lot of these cases is you'd probably want to log something to the Workflow History list, because without doing that, there'll be no record that this actually occurred. So I'll do that one as well. I'll click in there. Under my Action, I can see I've got an option here in the Core Actions section, a very common one called Log to History list. Just log a simple message. I won't go too crazy here. I could do lots of lookup, but I'm just going to say...
A document was moved to the HR Policies document library. I still have the button that I could Add or Change Lookup, meaning I can inject some information about it such as its URL, but I'm not going to bother doing that. So I think I'm done right now. Again, a very simple workflow. You can go much more complex than that. This would be just Step 1, but I could ask more questions. I could actually put in other steps. I can have parallel blocks and Else-If branches. What if it didn't include the word Policy? Maybe I want to check something else.
So there is a lot of stuff you can do. We're just touching the surface of it here. I'm going to go over here on the Ribbon to the Check for Errors button. It tells me the workflow contains no errors. Seems good. I'm going to save it. In a moment, what I need to do is publish it, but there is something I want to check first. I'm inside the workflow here, but I've got a few things that I can do such as the Workflow Settings, because on the Workflow Settings, we have some of the Start Options. When do I begin this workflow? Well, the last one that we did allowed the workflow to be manually started.
That's not what I want here. I want this workflow to be automatically started when an item is created. It's giving me some other options here, which if I was creating tasks, which I'm not. They put them in the tasks list. If I was creating any workflow history, which I am doing, it's going to go to the Workflow History list. I think I'm done. I'm going to hit Save and Publish. This will package up this workflow, and basically upload it into the SharePoint site onto that particular library. I can now close down SharePoint Designer. And then what? Well, I'm in the Shared Documents library.
I don't want to take anything off manually. I don't want to touch workflow. Since it is not something I'm interested in here. I just want to be able to do something like go to the document library here and I'm going to upload a document. I'm going to upload it into the wrong place. I'm going to browse, and luckily, I have something out there called an Expenses Policy document. I'm going to try that guy. Click Open and click OK. Now it uploaded it there, but let's actually sees something. I'm just going to hit my Browse window, and refresh the library.
That document has pretty much instantly disappeared, which is kind of what I was hoping for. In fact, if I look over here in HR Policies, yup, it's been moved to that other location and deleted from the original. Indeed, I would have been sent an e-mail at the same time saying that that had happened. The only challenge that you have is the normal way now of looking at your workflow history. It doesn't really exist, because workflow didn't happen on this item in this library. It happened on the copied version of it in the previous library, which now doesn't exist anymore.
So I might want to think about well, did I really want to delete that document, or perhaps I just wanted to add a note to it? If I wanted to go back into SharePoint Designer, I can do. Finding it under my SharePoint section, I can go back to that recent site that I just opened, go back into my Workflow section, find the three pre-existing ones, and there is the one that I had created. I can go into it. Click Edit Workflow, and I can actually start manipulating this again. It's a good idea, if you're building complex workflows to always do them kind of piece by piece.
Do them very slowly, logging information to the history list, because if you try and build a huge workflow from scratch and it doesn't work, it can be a bit of a pain to debug. Now obviously, we're just touching the surface here. There is a lot more complexity that you can do with workflow, but without code, we're managing to describe business processes, we're moving files around, we're sending e-mails, we can be changing options on those list items and those library items. So, a very powerful piece of SharePoint.
- Understanding a SharePoint team site
- Navigating lists and libraries
- Creating Document Workspaces
- Using versioning and check-in/check-out
- Integrating with Office 2010 applications
- Adding and deleting users
- Creating workflows
- Working with server site templates
- Creating a wiki and a blog
- Working with rich media
- Managing documents and other content
- Sharing information with charts and status indicators