When starting my new job as a System Administrator in Columbus, OH I came across a highly under utilized Sharepoint 2010 system. Having established a Sharepoint 2013 deployment in my last job, and having just enough knowledge of Sharepoint to make me dangerous, I decided that I would take it upon myself to make some additions which would take advantage of Sharepoint's workflow tasks. The first item on my chopping block was their out of office requests which were, up to this point, being done through Lotus Notes.
PREREQUISITES:
- Admin permissions to the page.
- Sharepoint Designer 2010
- Sharepoint Foundations 2010 deployment.
First, let's familiarize ourselves with the Sharepoint Designer 2010 layout so that we aren't fumbling around moving forward. When referring to Designer the "Ribbon" can be found at the very top of the page like many Microsoft's Office products since 2007. The left column, pretty self explanatory, can be found to the left of the main window. And the main window for our listening viewers out there can be found smack dab in the middle.
Now lets take a crack at this workflow:
Through sharepoint designer 2010 go to Lists and Libraries on the left hand side of the screen.
On the top ribbon select Custom List
Create a new list labeled Vacation request.
Click on your newly created list
Next we will add our needed columns to our customized list. Click on edit List Columns under Customization which can be found in the screens main section.
Next click Add New Column from the "Ribbon" found at the top left of sharepoint designer.
From here you can select the "type" of column you are creating. We will start by adding the Title which should be a single line of text
Add the Column Name, in this case "title" the type, this was already selected when clicking on the dropdown list, the description, for title is pretty self explanatory "title", and add whether you want the field required, in this case we do!
We will now add additional columns for the other information we will need moving forward. These will be created the same way as our title column was. For my needs I have Title, Username Full Name, Supervisor, Type of leave, Begin Date, End Date and Employee comments. My setup including column names, types, descriptions and whether they are required fields can be found in the image provided below
After our columns have been created make sure we save our work by right clicking the tab for the list and clicking save
We will now go back to the main page of our Vacation Request list. You can get there easily again by navigating to Lists and Libraries on the left hand side of designer and then selecting your Vacation Request list.
On the top of Sharepoint Designer 2010 in the ribbon you will now select List workflow.
We will name this WorkFlow "Out Of Office Request"
We will next be presented with an empty task screen.
By right clicking within the step we can add conditions and actions. This can also be done through the Ribbon by clicking action or condition.
We will start off by sending an email to the user that their request has been accepted. Click within the Step and then from the ribbon click action and select Send an Email. Next, click on the blue text labeled "these users"
You will presented with a secondary window. Click on the address book next to To:
We will want this email to go to the user that put in the request in the first place. Select User who created current item and then click add.
After clicking ok you will be returned to the original window. We will next add a subject line to the email.
We will also want to add some information for the user about their request. We can add this information in the body of the email. We can call upon the data from the original task by clicking on the "Add or Change lookup" on the bottom of the current window.
In the "Data Source" field we will select Current Item. The "field from source" will relate to the current data we want to include in the email. For example if we wanted the users type of leave we would select the type of leave item. In this instance I want to tell the user the type of leave they were requesting along with the dates and who the approval request was sent to.
Upon selecting type of leave click OK. It will be added to your email.
I have set up my email with the following fields. These were all selected by following the above steps and cannot be copied and pasted or typed in with a similar format. I SAY AGAIN, the only way to add a field is by selecting it through the above process.
After all of your information is added to the email click OK at the bottom of the "Define E-Mail Message" window
Next we will add a second step to our process. Right click outside our original step and select "Step"
Click within our new step and select "Start Approval Process" from our Action button on the ribbon
This process will send a task to the manager to approve/reject our Out of Office Request. We will change the individual that the process is assigned to by clicking "these users" much as we did with the email step above. Click the address book next to the participants field
This time we will click the "Workflow Lookup for a User..." selection and then click Add.
We will now be presented with a secondary box.
Once again in "Data Source" we will select Current Item. In "Field from source" we will select supervisor. This field is once again being pulled from our original list that we created in the initial steps.
Leave this return field as "As String" and click OK. Add any other users you would like the task to be assigned to. For instance if you wanted someone from Human Resources to know about the request or a secondary supervisor or manager.
Click OK again to be returned to the "Select Task Process participants box". Add whatever title and information you would like the supervisor to have for the approval request. I added the type of leave and any comments that the user had. You can do this by referring to the steps that we used when creating the original email. (Add or change lookup, etc.)
After this looks the way you would like it click OK.
We will now add another step to our process by right clicking outside of step 2 and clicking step
We will now add another step to our process by right clicking outside of step 2 and clicking step
These next steps will add any approved requests to the Sharepoint calendar and send an email to the user informing them whether the request was approved or denied. Select step 3 and then go to condition on the sharepoint designer ribbon. Select "If any value equals value"
We will now click on value within the newly created condition which will create an "fx" botton. Click the "fx" button
Next, we will select Workflow Variables and Parameters as our "data source" and Variable: IsItemApproved for our "field from source". Click ok
In this instance we want our "equals" value to be Yes. So click "value" and then select Yes from the drop down.
Using a similar process as before we will now create an email task to send an email to users when their Out of office request is approved.
We will start off by sending an email to the user that their request has been accepted. Click within the Step and then from the ribbon click action and select Send an Email.
After clicking on "Send an email" you will see it show up under your step (pretend step 1 says step 3 here). Click on the blue text labeled "these users"
You will presented with a secondary window. Click on the address book next to "To":
We will want this email to go to the user that put in the request in the first place. Select User who created current item and then click add.
After clicking "OK" you will be returned to the original window. We will next add a subject line to the email.
We will also want to add some information for the user about their request. We can add this information in the body of the email. We can call upon the data from the original task by clicking on the "Add or Change Lookup" on the bottom of the current window.
In the "Data Source" field we will select Current Item. The "field from source" will relate to the current data we want to include in the email. For example if we wanted the users type of leave we would select the type of leave item. In this instance I want to tell the user the type of leave they were requesting along with the dates and who the approval request was sent to. (If you haven't noticed by this point these are quiet literally the same steps as we used before when sending an email).
Upon selecting Type of leave click OK. It will be added to your email.
I have set up my email with the following fields.
After clicking "OK" we will return to the original workflow screen. We will now want to create a calendar item within our Sharepoint calendar. Click underneath the email task and then on the Designer Ribbon under action select "Create List Item"
Click the new popup box labeled "Create new List Item" and select the "List" you would like for the item to be created in from the drop down box. My calendar easily enough is called Calendar.
You will now need to associate the "field" column with the "value" you want added to the new entry. Select one of the list fields and then click modify.
Click the fx button next to the "to this value" field.
We will now select the data that we want displayed as the title of the new list item. In my case I want it to be the name of the user in question. So for "Data Source" i select Current Item again and in "Field from source" I select Username. Since this is a string leave the "Return field as" as As String
Click OK and OK again. You will now do this for the rest of the items being requested. Below you can see what settings I have put in place.
After these items have been updated click OK.
For the final step of the process we will send an email to the user if their time has been rejected. From underneath the grey line we will select and add the condition "Else"
For the final step of the process we will send an email to the user if their time has been rejected. From underneath the grey line we will select and add the condition "Else"
This can be done with a right click and then selecting Else-If Branch
Our else clause will be simple. Just sending an Email to the Created By user saying the time was rejected.
Click within the Step and then from the ribbon click action and select Send an Email. After clicking on Send an email you will see it show up under your step. Click on the blue text labeled "these users"
Click within the Step and then from the ribbon click action and select Send an Email. After clicking on Send an email you will see it show up under your step. Click on the blue text labeled "these users"
You will presented with a secondary window. Click on the address book next to To:
We will want this email to go to the user that put in the request in the first place. Select User who created current item and then click "add".
Click "OK" and add the rest of your information.
Your finished project should look something like this.
Your finished project should look something like this.
Click Save on the ribbon and then publish you project. Please remember to "Publish" your project. Without publication Sharepoint will not put your workflow into production.
From here we can go back to our Sharepoint site and begin using our List.
Just as a quick run through. Click on Vacation Request.
Just as a quick run through. Click on Vacation Request.
Next click on Add new Item
Add your vacation information as you see fit.
After this has been submitted our vacation process will send an email to the submitter and then add a task for the person listed as supervisor.
Their approval or rejection will shoot us an email and add it to the calendar that we have requested within out workflow!
I can't believe no one else has commented on this...this is the best post I've seen on this. Details for EVERY step (literally!). THANK YOU for creating this excellent resource; exactly what I needed!
ReplyDelete