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:
- 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.
- 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).
- 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.
- Create a new list workflow. For more details on how to create a list workflow, refer to
Create a list workflow use case.
- In the main menu ribbon, in the
Workflow group, click on
Settings and configure the workflow settings as follows:
- Drag the following activities onto the workflow canvas and drop it onto a design node as follows:
- Notification. Change title to "Notify Requester".
- Request Approval. Change title to "Manager Approval".
- Set Workflow Status. Change title to "Set Workflow Status-Rejected".
- Set Workflow Status. Change title to "Set Workflow Status-Accepted".
- Create Log History. Change title to "Log to History-Rejected".
- Create Log History. Change title to "Log to History-Accepted".
- Notification. Change title to "Notify Requester-Request Rejected".
- Notification. Change title to "Notify Requester-Request Accepted".
- Configure the "Notification Request" activity as follows:

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.

- In the Insert Link dialogue, do the following then click on OK:
- 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.

- Configure the "Manager Approval" activity as follows:
In the
ACTIVITY SETTINGS group, click on
General Settings group and configure it as follows:
In the
ACTIVITY SETTINGS group, click on
Notification Message group and configure it as follows:
- Configure the "Set Workflow Status-Rejected" activity as follows:
- Configure the "Set Workflow Status-Accepted" activity as follows:
- Configure the "Log to History-Rejected" activity as follows:
- Configure the "Log to History-Accepted" activity as follows:
- Configure the "Notify Requester-Request Rejected" activity as follows:
- Configure the "Notify Requester-Request Accepted" activity as follows:
- Publish the workflow by clicking on the
Publish button in the workflow ribbon.
- Now you can test the workflow by adding a new item to the list that this workflow being created on.