How to notify customers before a contract is expiring?

Last Update: December 30, 2018

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

Suppose you have a list named "Customer Contracts" and you want to monitor the expiration date of the contracts and notify the customers by email before 7 days the expiration date is due.
There are two methods to implement the above scenario:

  1. Method #1: Create a list workflow that will start when a new item is created or updated.
  2. Method #2: Create a centralized workflow that will start on a predefined schedule.

Here are the steps on how to implement the two methods.

Method #1:

  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. Drag "For Each", "If Condition" and "Notification" activities onto the workflow canvas and drop it onto a design node How to notify customers before a contract is expiring11.png as follows:
    How to notify customers before a contract is expiring1.png
  3. Configure "Delay Until" activity as follows:
    How to notify customers before a contract is expiring2.png
  4. Configure "Notify Customers" activity as follows:
    How to notify customers before a contract is expiring3.png

Method #2​:

  1. Create a new site workflow. For more details on how to create a site workflow, refer to Create a site workflow use case.
  2. Drag "For Each", "If Condition" and "Notification" activities onto the workflow canvas and drop it onto a design node How to notify customers before a contract is expiring11.png as follows:
    How to notify customers before a contract is expiring4.png
  3. Configure "For Each" activity as follows:
    How to notify customers before a contract is expiring5.png
    The above CAML query will return all contracts that will expire within 7 days from the current date.
    Note: A workflow variables named "varContractExpirationDate" of type DateTime and "varCustomerEmail" of type Text should be created to store the values of contract expiration date and customer email when looping through each value in the for each.
  4. Configure "If Condition" activity as follows:
    How to notify customers before a contract is expiring6.png
    Set the Where condition as follows:
    How to notify customers before a contract is expiring7.png
    Note: The "If Condition" activity notifies only customers that their contracts will expire in 7 days.
  5. Configure "Notification" activity as follows:
    How to notify customers before a contract is expiring8.png
  6. Publish the workflow by clicking on the Publish button in the workflow ribbon.
  7. In the Settings Icon How to notify customers before a contract is expiring9.png, click on SPARK Workflow Scheduler then click on Add Schedule button when you finish.
    How to notify customers before a contract is expiring10.png