How to create a leave request workflow using SPARK Workflow?

Last Update: December 24, 2018

Apply for: SPARK Workflow for SharePoint 2013/2016 and Office 365

This use case shows you how to create a leave request workflow when a new request is added to the related list.
Suppose you have the following steps of the leave request process you want to create:

  1. The employee fills in the form. The system sends an email notification to the employee (the requester) to inform him/her that the request has been submitted.
  2. The workflow creates an approval task for the employee’s manager and sends him/her a notification about the new task (the new leave request).
  3. The Employee's manager approves/rejects the request. The system sends an email notification to the requester of the workflow status (accepted or rejected).

Here are the steps on how to do that.

  1. Create a new list workflow. For more details on how to create a list workflow, refer to Create a list workflow use case.
  2. In the main menu ribbon, in the Workflow group, click on Settings and configure the workflow settings as follows:
    How to create a leave request workflow using SPARK Workflow1.png
  3. Drag the following activities onto the workflow canvas and drop it onto a design node as follows:
    1. Notification. Change title to "Notify Requester".
    2. Request Approval. Change title to "Manager Approval".
    3. Set Workflow Status. Change title to "Set Workflow Status-Rejected".
    4. Set Workflow Status. Change title to "Set Workflow Status-Accepted".
    5. Create Log History. Change title to "Log to History-Rejected".
    6. Create Log History. Change title to "Log to History-Accepted".
    7. Notification. Change title to "Notify Requester-Request Rejected".
    8. Notification. Change title to "Notify Requester-Request Accepted".
    How to create a leave request workflow using SPARK Workflow2.png
  4. Configure the "Notification Request" activity as follows:
    How to create a leave request workflow using SPARK Workflow3.png
    Note: $func-EmailBodyURL('Leave URL','$WFcontext(ItemUrl)') represents the Item URL that will appear as a hyperlink in the email body that will be sent to the requester.

    You can add a hyperlink to the message body using the following steps:
    • Select the INSERT ribbon, then click on the Links button.
      How to create a leave request workflow using SPARK Workflow4.png
    • In the Insert Link dialogue, do the following then click on OK:
      How to create a leave request workflow using SPARK Workflow5.png
      • For the "Text to display", type the text of the hyperlink that will appear in the received email body.
      • For the "Address", click on (fx).
      • In the Workflow Context, double click on the "Item URL" then click OK.
        How to create a leave request workflow using SPARK Workflow6.png
  5. Configure the "Manager Approval" activity as follows:
    In the ACTIVITY SETTINGS group, click on General Settings group and configure it as follows:
    How to create a leave request workflow using SPARK Workflow7.png
    In the ACTIVITY SETTINGS group, click on Notification Message group and configure it as follows:
    How to create a leave request workflow using SPARK Workflow8.png
  6. Configure the "Set Workflow Status-Rejected" activity as follows:
    How to create a leave request workflow using SPARK Workflow9.png
  7. Configure the "Set Workflow Status-Accepted" activity as follows:
    How to create a leave request workflow using SPARK Workflow10.png
  8. Configure the "Log to History-Rejected" activity as follows:
    How to create a leave request workflow using SPARK Workflow11.png
  9. Configure the "Log to History-Accepted" activity as follows:
    How to create a leave request workflow using SPARK Workflow12.png
  10. Configure the "Notify Requester-Request Rejected" activity as follows:
    How to create a leave request workflow using SPARK Workflow13.png
  11. Configure the "Notify Requester-Request Accepted" activity as follows:
    How to create a leave request workflow using SPARK Workflow14.png
  12. Publish the workflow by clicking on the Publish button in the workflow ribbon.
  13. Now you can test the workflow by adding a new item to the list that this workflow being created on.