Building a SharePoint Designer workflow that automates email can save a ton of time. Gini Courter shows how to take advantage of this powerful automation.
Sending an email is one of the most frequently used actions in SharePoint workflows. Because we send people emails to let them know that it's time to look at a document, or to take a particular action. We use them for transparency, to let a user know that a particular document has been received, or that an item that they posted in the list has been moved to the next stage of a process. So, we're going to use email a lot. And this is the very first action that we're going to see how to create.
I've created a new HR site that I'll be using for the next few workflows that we create. And just a note that if the site that you are using or were thinking of using to create workflows in for practice has other users in it, it's an actual production site. This is a really good time to get a site set up that you can use that doesn't have other users in it, particularly people who are there just trying to get their work done on a day to day basis. And then we're creating new work flows that they don't need to use and they don't need to understand.
So get yourself a nice pristine site with only users who volunteer to be guinea pigs to help you learn. And that's what my HR site is, a site with very few users. I'm going to swing over to SharePoint Designer. And I've already opened up the site. So if it wasn't open when you to sites, you can choose open in order to open it. And there are two major ways that I will start a workflow. The first is to say I want to create a new list workflow. That’s what we’re creating right now.
And then I’m allowed to choose from the list and libraries that are here in this site. So that’s where this list comes from. And if I wanted to create a new list to the documents library, I can do that. My other choice is to look at my lists and libraries, open the library I want, and as I scroll down on the right hand side, notice that I have the ability to create a new workflow in the workflow section for this list. So let's do that. And let's give this workflow a name, which is going to be send email to Document library owner.
Okay. And I might even say, send new document email. I like that better. So we're going to send a new document email to the document library owner, to say, hey, there's a new document that was put in this library by this person, and you might want to go review it then. This library owner, who's the director of HR, could actually just go set an alert. But then you and I wouldn't have the ability to learn about how to use this. And there are many times that people really aren't in a position to set a specific enough alert for what we want to tell them.
We're going to enter a description and it will appear in SharePoint Designer and in other places under the hood of SharePoint. So, if your name is not terribly verbose, if we just said, send new document email, which would be another choice to have a nice short name here, then, what I could do is take this and put it in the description. So what I have is created by Jenny Quarter. When a new document is added to the documents library, this workflow automatically notifies the document library owner. Cool, good enough.
Now I need to choose the platform. And this is basically asking, what server do you have? This version of SharePoint Designer can create SharePoint 2010 workflows and SharePoint 2013 workflows And all you really need to know is what server you are on. If you are on a SharePoint 2013 server, then that's all you need to know. Now, the reason they're both here is, it's not unusual to work in an environment where some of the servers are 2010 and some of the servers are 2013, and they'll all get to 13 eventually, about the time we go to the next version.
If you have some 2007 servers, and I have clients who have them, you'll need another version of SharePoint Designer to be able to create workflows, and it's very different. There's been a big shift in how workflows are created between 10 and 13, but even larger between 07 and 10 in some ways. So you can't even this SharePoint Designer to create 2007 workflows. I'm going to say okay here. And right now, what SharePoint did very, very quickly is return to SharePoint Designer some information about the metadata that's available in that particular library.
I'm going to simply edit the stage name here to say, send email. And, I'm going to now add an action. Ad there are two different ways to do it. And you want to be keenly aware of where you are. If I'm in this section, notice that, that orange line is lit up in the transition to stage section. If I'm here, then the orange line is lit up in the stage itself. These are two separate areas. At the top, what we have is the actions that we want to take, or some conditions that we might want to add. Do this action if, and if not, do this other action.
The transition to stage are actions that say where we go when we're done with this particular action in this stage or this group of actions that we put together. It says start typing or use the insert group on the ribbon. If we use the insert group up here, we want to add an action. And I've recently done a send an email workflow,. But if you haven't, you're going to find that It's right down here under core actions, send an email. So that's one way, is you can go up here and choose it. You can also begin typing the name of it, even though it doesn't look like you can.
Nine of them start with SE, so I could press enter and it will bring all of these up and I can choose. But as soon as I get to SEN, there's only one, send an email, and I can just press enter. It says email these users. I click on that hyperlink and it opens a message form, so that I can address this to somebody. Now while I"m doing testing, I actually want to send emails mostly to myself. So, it looks like I should be able to type here, but I really can't. It's grayed out. I'm going to need to click to open this select users dialog.
And I can choose people or groups from SharePoint sites, I can do a lookup. But what I want to do right now is just send it to me. So there I am. And I'm going to click okay. I could copy somebody else on it. If I decide that I want to get rid of somebody here, the way I do it is to click again on our select users icon, choose me, for example, and remove me. I can't be doing editing up in these two areas. Now I want to provide a subject. And I could simply type new document.
But the user, Carol, is going to get lots of these, and that is going to force her to have to look at the body of the email, or even open the email, depending on her Outlook settings, to see what this document is. So I would like to put the title of the new document up here in the subject. And I'm going to show you how to do that. There is an F of X button here, that will allow us to do a lookup in the current item. And I could say, you know, in the current item, or someplace else, I want to choose the title. And by current item, it doesn't mean this workflow.
It means the document that was saved, the item that was saved in a list that actually kicked this workflow off. So I can say I'd like to actually put the title here. And if I do that, that's all I'll get. And it will look like this. So then, all it is, is a document name. I'd like to do a little bit better than that. So I'm going to click the build button here, and open up the string builder. And I could add text in front of this. But now that I am in an editable place I'm just going to select that. I'm going to say new document submitted.
Carol may also have multiple libraries, but if she doesn't, if I just say new document, then click the add or change lookup button, which is exactly the same functionality as this F of X button right here. So I go to current item and I choose title. Okay. New document. Current item. In HR documents library. Now, if she's only monitoring one library, she probably doesn't even need me to say that. Don't worry about the fact that it kept this underscore from when I had the title there, because it's going to go in the subject line and it's going to remove it.
That underlining won't be with us anymore. That looks good. I'm going to say okay. So new document dash document name in HR documents library. Now I need to provide any other text that I want to put in this email message. So I can format in this area. I have some different fonts to use. I have sizes of fonts. And you should think of these as the internet sizes, where 1 is a pretty small font, 3 is about a 12 or 14 point, 2's about a 10.
And you can change colors, you can insert hyperlinks. These are the kinds of things that we can do here. So I'm just going to leave what we had a moment ago. And I'm going to say not too much, because she's going to get a lot of these emails. She'll be used to them. The new document, and I'm going to put its name here. I might even want to say, this new document was posted in the library, by, and we'll put somebody's name, like that. So this new document.
Now, I could just put the title, and I would do that the same way I put it in the subject. But I want to make this wicked easy for her to be able to click a link and go right back into that document. Now I'm starting to deliver some value. So this time, when I click add or change lookup from the current item, I'm not going to choose the title. I'm going to choose something called the encoded absolute URL. You want to remember this. Encoded absolute URL always provides a link that works in any circumstance for anybody who has permission to get to that specific item in a site.
So if you put an encoded absolute URL, whether you're pointing to an item in a list or to a page or someplace else in SharePoint, if the user has permission to get there, this is going to get them there. And I'm going to say okay. So, this new document was posted in the library by, now let's go get the name of the person who changed it, who actually posted this document. So, we'll go back to current item, and this is when you really have to know how libraries are organized in SharePoint.
Because the person who saves a document, or posts it, is the created by person. And there are several ways that I can return this field. I can use their email address, I can use a userid number, not a lot of good here. I can use their login names. But I'd just as soon use their display name. In this case you know, my display name is going to say Jenny Quarter. Carol's is going to say Carol Tyson. So it's nice and clear. There's no need, if we wanted them to be able to email we could say to email this person, we could put the email address as well.
But this looks good. . And then finally, we would want to put some kind of a signature here. It could be as simple as, this email is automatically generated by a SharePoint workflow. Do not reply to this email. Cool. That's what my email looks like. So, again, the steps that got us here, before I click okay, are we said that we wanted to create a new workflow. And then we chose an action, which was, to send an email message.
We clicked the hyperlink, where it says email these users. And this form opened. And then we chose at least one user to send this to. We created a subject using the builder button. And we created the body of the message using regular text and building this as well. I’m going to click okay. And this point I am going to click save. And that's how we generate the send an email action within a SharePoint workflow.
Notice that now that I have saved this, it's going to appear here on the list, send new document email, right here. This is an item that had been created earlier, and it is not live at this point. So right now all it is is saved. It's not available to anybody to use. So if I go to workflows, or if I go to my library and go to documents, and we scroll down and look at our workflows, this workflow is not yet available for use by my users.
We are going to learn how to save and publish our workflow in the next movie.
- Automating workflows
- Documenting workflows with Sticky Notes, Excel, and Visio
- Driving workflow interactions with forms
- Using workflow actions
- Making choices and controlling flow with conditions
- Creating a simple form
- Using email notifications
- Pausing and stopping workflows with core actions
- Building a dictionary
- Creating a site workflow
- Deploying workflows
- Creating workflows visually
Skill Level Intermediate
Q: In the video "Creating a workflow with conditions," the email workflow generates the email and successfully changes the value in AreaCalc but the workflow does not complete, and raises no errors. How can I fix this?
Q: Where do I get InfoPath Designer 2013 (mentioned in the "What you need to know" video)?
- If you have Office 2013 Pro, you may already have InfoPath Designer 2013, but it may not have been installed. Try reinstalling Office and choose to install InfoPath Designer.
- Sign up for a free 30-day trial of one of the Office 365 plans that include InfoPath Designer—for example, Office 365 Enterprise (E3) Edition, which also includes SharePoint, or Office 365 ProPlus, which does not include SharePoint. After the 30-day trial you will need to pay a monthly fee for Office 365.