Skip to main content
Search Again

We think these articles could help you:

    See More
    Nintex Knowledge Base

    Step 3: Building a leave workflow for your team

    Prepare for success

    • You must have at least the following permissions to complete this step:
      • Full Control on the List
      • Contribute on the Site
      • Read on the Site Collection

    For more information, see Understanding permission levels in SharePoint.

    Building a leave workflow

    Now that you have built your first workflow and have a better sense for some of the design considerations for SharePoint Online workflows, let's build a leave request workflow for your team.

    Create a SharePoint list

    Create a SharePoint list called Leave Requests, with the following columns:

    • 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)


    Tip: If you don't know how to create a SharePoint List, refer to this article (Build a SharePoint list for your Nintex Workflow or Forms 2016) for instruction.

    Create a leave calendar

    To create the calendar

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


    Add a leave request page (optional)

    You may want to create a page for the two SharePoint apps. This page will display all the Leave Requests made as well as the leave calendar.

    To create a page

    1. Click on the Settings icon in the top right –hand corner and select Add a Page.
    2. Call the page: 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. 
    3. In the Ribbon, click Insert and then click Web Part


    1. In the Apps category, you click Leave Calendar and select Add
    2. Click Leave Requests and select Add.


    SharePoint Online adds both apps to the page as web parts.

    1. Click on the Page tab and select Save.

      Your page should look similar to the screenshot below (The list shown already has one approved leave record).


    Build your workflow

    To build a workflow

    1. Navigate to the Leave Request SharePoint list.
    2. In the Quick Launch menu, click on the List tab and then select Nintex Workflow.


    1. On the Workflow Gallery page, click New list workflow.

    Create a variable

    To create a variable

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


    Add a Send an email action

    To add Send an email action

    1. Drag a Send an Email action onto the canvas.
    2. Double- click to open the dialog box. This email will be sent to the initiator of the workflow. 
    3. In the To field, click on the List Lookup icon.
    4. In the first drop down menu, select Workflow Context and the Initiator in the second drop down menu.


    1. 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. 

    1. In the Email body, add a message.

      For example, type: 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.


    1. Click Save.

    Add an Assign a task action

    To add an Assign a task action

    1. Locate the Assign a Task action in the User Interaction workflow toolbox.
    2. Select and drag the action onto the canvas below the Send an email action.
    3. Double click on the action to open the dialog box. 
    4. In the Participant field, assign it to the Manager.
    5. Type Administrator into the field. 
    6. 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.


    Notice the Task Outcome section has automatically defaulted two outcome options - Approved and Rejected. The workflow automatically displays these outcomes 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. 


    Add a Send an Email action

    To add Send an email action

    1. Drag and drop a Send an email action onto Rejected side of the Task action. This action notifies the Initiator that their leave request has been declined.
    2. Double-click to open the dialog box. 
    3. In the To field, click on the List Lookup icon. Select Workflow Context and then Initiator
    4. In the Subject field, type: Your leave request has been declined.
    5. In the Email Body field, type: Declined.


    Add another Send an email action

    To add another Send an email action

    1. Click on the drop down arrow on the left-hand side Send an Email action.
    2. Click Copy.
    3. Click on the Approved side of the Task action, right-click on a drop- zone and select Paste.
    4. Double-click on the action to open the dialog box.
    5. In the Subject, change the word declined to approved.
    6. In the Email Body, change the message to Approved


    Add a Create List Item action

    To add a Create list item action

    1. Drag and drop the Create List Item onto the canvas, on the right-hand side of the Conditional Branch.

      You can find the Create List Item action in the Libraries and Lists toolbox category.
    2. In the Target List field, select the Leave Calendar. Once a leave request has been approved, the leave dates appear in this calendar. 
    3. In the Title field, select Workflow Context, and then Initiator. We also want the Initiator output to appear as the Display Name.
    4. Click on the orangefx to the right of the Initiator drop down menu. 


    1. Select the Display Name format and then click Ok


    1. In the Start Time field, select List Lookup, and then Start Date in the Field drop down menu.
    2. In the End Time field, select List Lookup, and then End Datein the Field drop down menu. 
    3. Click Save


    Publish and run the workflow

    You're ready to publish and run the workflow.

    1. Click Publish in the Ribbon and give the workflow a title Leave Request Workflow.
    2. Automate the start of the workflow, by checking the Start when items are created checkbox. 


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

    Check for success

    • Where you able to create your leave calendar?
    • Where you able to access the Nintex Workflow designer?
    • Where you able to publish the leave request workflow?
    • Where you able to run the workflow and approve the request?
    • Was this article helpful?