Create a Leave Request Workflow in Nintex Workflow for Office 365

Document created by Emily Billing Employee on May 11, 2014Last modified by Pamela Denchfield on Aug 20, 2015
Version 11Show Document
  • View in full screen mode

This tutorial demonstrates how to build a leave request workflow using Nintex Workflow for Office 365 and uses two SharePoint apps; a custom SharePoint list called “Leave Requests” and a Calendar. 

 

For a related tutorial, see "Automate leave request notifications" in the Nintex Workflow for Office 365 help.

 

Create a SharePoint List

Create a SharePoint List called "Leave Requests", with the following columns. Refer to this article to see how to create a SharePoint List.

  • Leave Type (Choice – drop down menu) with the following selections; Annual leave, Sick Leave, Leave without Pay, Carers’ leave. 
  • Start Date (Date and Time)
  • End Date (Date and Time)
  • Description (multi-line textbox)

leave_list.png

Create a Leave Calendar

To create the Calendar, click on the Settings icon in the top right –hand corner and select Add an App. Click on Calendar, and call it “Leave Calendar”.

leave_calendar.png

Add a Leave Request Page (optional)

You may want to create a page for the two SharePoint Apps to sit on. This page will display all the Leave Requests made as well as the leave calendar. To create a page, click on the Settings icon in the top right –hand corner and select Add a Page. Call it “Employee Leave”. 

To begin, the page will be blank, so you will need to add the webparts for the Leave Request list and Leave Calendar. 

Click on Insert in the Ribbon and then Web Part

web_part.png

In the Apps category, you will find the Leave Calendar and Leave Requests apps. Click on them and select Add. They will be added to the SharePoint page as a web part.

add_web_part.png

Click on the Page tab and select Save. Your page should look similar to the screenshot below (my calendar and list is already populated with one approved set of leave).

employee_leave_calendar.png

 

Build your workflow

Navigate to the Leave Request SharePoint list in the Quick Launch menu, click on the List tab and select Nintex Workflow in the Ribbon.

NW.png

On the Workflow Gallery page, click New list workflow.

Create a Variable

Click on Variable in the Ribbon. This variable is going to store the outcome of the approval task. Call the variable “Task Outcome” and select the type Integer. Click Save.  

variables.png

 

Add a Send an Email action

Drag a Send an Email action onto the canvas. Double- click to open the dialog box. This email will be sent to the initiator of the workflow. 

In the To field, click on the List Lookup icon. In the first drop down menu, select Workflow Context and the Initiator in the second drop down menu.

initiator2.png

In the Subject field, type “Your [leave type] request has been received”. 

Note: The [leave type] Insert reference is accessed through the Insert Reference column on the right-hand side of the action dialog box. 

In the Email body, add a message. For example: “Your [leave type] request starting on the [start date] until the [end date] has been received and has been forwarded to your manager for approval.”

Note: The [leave type], [start date] and [end date] information comes from the Workflow Context section of the Insert Reference dialog.

send_email.png

Click Save.

 

Add an Assign a Task action

Locate the Assign a Task action in the User Interaction workflow toolbox. Select and drag the action onto the canvas below the Send an Email action. Double click on the action to open the dialog box. 

In the Participant field, assign it to the Manager. Type “Administrator” into the field. 

In the Task Title field, type “Leave request for…” and then add in “Initiator display name” from the Workflow Context section of the Insert Reference dialog.


AssignaTaskOutcomes.png

 

 

Notice the Task Outcome section has automatically defaulted two outcome options - Approved and Rejected. These outcomes will be displayed automatically on the design canvas to continue building the workflow.

 

Note: You have the option to select LazyApproval in the Assign a Task and Start a Task Process actions. With LazyApproval, reviewers can approve or reject items by sending email replies that contain a valid phrase.

 

lazyapproval.png

 

Add a Send an Email action

The next step is to drag and drop a Send an Email action onto Rejected side of the Task action to notify the Initiator that their leave request has been declined. Double-click to open the dialog box. 

 

In the To field, click on the List Lookup icon. Select Workflow Context and then Initiator

 

In the Subject field, type “Your leave request has been declined”. And then in the Email Body field, type “Declined”.

declined_email.png

Add a second Send an Email action 

Click on the drop down arrow on the left-hand side Send an Email action. Click Copy.

 

Click on the Approved side of the Task action, right-click on a drop- zone and select Paste. Double-click on the action to open the dialog box.

 

In the Subject, change the word “declined” to “approved”. In the Email Body, change the message to “Approved!!” 

approved_email.png

 

Add a Create List Item action

The final action is Create List Item, which you will find in the Libraries and Lists toolbox category. Drag and drop the Create List Item onto the canvas, on the right-hand side of the Conditional Branch. 

 

In the Target List field, select the Leave Calendar. Once a leave request has been approved, the leave dates will be entered in this calendar. 

 

In the Title field, select Workflow Context, and then Initiator. We also want to coerce the Initiator output to appear as the Display Name. Click on the orange fx to the right of the Initiator drop down menu. 

target_list.png

Select the Display Name format and then Ok

display_name.png

In the Start Time field, select List Lookup, and then Start Date in the Field drop down menu. In the End Time field, select List Lookup, and then End Date in the Field drop down menu. 

Click Save

start_time.png

 

Publish and run the workflow 

We’re now ready to publish and run the workflow. Click Publish in the Ribbon and give the workflow a title “Leave Request Workflow”. Automate the start of the workflow, by checking the Start when items are created checkbox. 

publish.png

Close the workflow designer, return to your SharePoint list and add a new item to run the workflow. 

Attachments

    Outcomes