SharePoint Designer Workflow – Send Email Reminder X days prior to a Date

by Oscar 25. June 2008 05:12

Business Problem


One of my clients wanted to send email reminders to users one week prior to the project assigned tasks Due Date.

Solution


As you may or may not know, MOSS does not have that built-in functionality, but it is easily accomplished via a workflow created using the SharePoint Designer 2007.

Architecture

Calculated Column
I feel that working with complex date calculations (view my other post for a more date formulas  SharePoint List Calculated Column - Calculate Business Days) are best done on the SharePoint List side.  Therefore, I decided to have a calculated column that would already have the DateTime for when I need to send my Email Alert.

In this scenario it was fairly straight forward and so my formula simply looks like this:
image

This is what the column looks like when viewing the list items.  If you look closely, you will see that the column Days Prior To Due Date shows 3 days, but my email reminder column says the date to send my email is 6/21/2008.  The reason is that the formula on that column excludes weekend days!  image 

Workflow

The first Step on the workflow – Set Reminder Time

  • I use the Add Time To Date Action, but don’t actually add time, I simply capture the value of the column TaskEmailReminderDate and store it on a variable called ReminderDate for use on my Step 2.
  • Store the Task Title on a variable called SubjectTaskTitle, used when sending my email
  • So that I can debug, I simply use the Log To History List Action to view the value of the ReminderDate variable



image

The Second Step on workflow – Send Task Reminder Email

There are no conditions, this step simply uses the Pause Until Date Action and uses the variable on Step 1 called ReminderDate to send out my email.
image


NOTE:
When I was testing my workflow, I was of course logged in as the “Administrator”, and so the workflow always failed to start automatically!  View this KB article for details.  My resolution was to simply create another account in AD and grant that account admin rights to my portal.  This prevented me from updating the Application Pool Identity for my Web Application.

Well I hope this helps you and let me know if it did!

Cheers,
Oscar

Tags:

Comments

6/26/2008 10:41:24 PM #

Is there a way to calculate a due date X number of business days into the future on a sharepoint list?

C United States | Reply

7/11/2008 7:22:10 PM #

Hi C,

I suppose you can, if you grab the value of your "business Days" calculated column and check for the number of days it returns. If the number is what you are looking for, then display some message for example.

I would try to add an additional calculated column that checks the value of the "business days" calculated column to do this.

Let me know if that helps,
Oscar



Oscar United States | Reply

8/13/2008 1:39:22 PM #

hello oscar

is it possible to send an email 2-3 days in advance from a calendar entry?

Rajpal India | Reply

9/5/2008 5:18:25 PM #

Hi Rajpal,

If the List you are attaching your SPD Worlfow to is a Calendar List, yes. You should be able to lookup the value of the calendar event start date on your workflow and base your calculations out of that date.

Oscar United States | Reply

10/20/2008 8:58:29 PM #

Hi,

I'm having trouble getting this to work on a recurring item. The calculated field for all the recurrences is using the [Start Date] from the original item. If I edit the individual item the calculated date will get updated. Just wondering if you knew any way around this.

Thanks,
Matt

Matt Canada | Reply

10/24/2008 8:53:17 AM #

hi,

i have the same requirement for an application. i need to have 2 fields to hold 2 diff due dates to send reminder email if date today is the same as the due date

so for the first one, i have to have a column for 'Supervisor Due Date' which is just equal to Created+7 (this works fine), then I had in my workflow step: If Supervisor Due Date equals now() then Email Supervisor. (am i right with this one?)

then the second due date pertains to Admin Due Date. I created a column in my list and set it to =IF([Status]="Pending", [Modified]+7, "") but date are always displayed as 1/6/1900. do you know any other approaches to do this. the condition for it is once my other workflow run and set the status from New to Pending, then the Admin Due Date would be set to seven days after the status was changed to Pending.

I hope you could help me..

jeiku Republic of the Philippines | Reply

12/4/2008 6:01:44 PM #

Oscar,

Great writeup...just what I was looking for!  I have one follow up question - maybe you can point me in the right direction.  The workflow referenced ends once the email is sent out based on the 'reminderdate'.  

Is there any way to have the workflow run infinitely and continuously monitor that field?  Here's my dilemma - I'm trying to develop a quick and easy app using a Sharepoint list to notify me and my team when AD system accounts are due for their yearly password change.  (currently a manual process) So in the list I have a field that records the 'LastPasswordChange' date and then I have two calculated fields:  'NextPasswordChangeDate' and 'EmailReminderDate'.

When I change the 'LastPasswordChange' date the other two fields are updated as well.  So if I change the password for an AD system account and update the 'LastPasswordChange' field the workflow will not notify me because its status is already 'Complete'.  Is there a way I can set it up to always keep it alive?  

Thanks a bunch!

Vikas Bangia United States | Reply

1/27/2009 9:04:04 PM #

Do I need to add weekdays values for this formula?

cris United States | Reply

1/29/2009 2:05:17 AM #

is there a way to do this for recurring events, such as a persons birthday which sends out an email each year.
I have not managed to find a way of doing this, other than using a third party web part.

Thanks in advance

ivor United States | Reply

4/24/2009 5:37:22 PM #

First of cracking blog,

I have just recently developed a work flow which is almost self reliant. What it does is check the status of the task. If it is not started and the start date is the current date it initiates the workflow if not it waits until the the start date to begin. When the date reaches the start date it switches the status to inprogress and sends and initial reminder to the person who the task is assigned to. The work flow then pauses depending for a set period of time dependsing on a property of the task. This allows me to send daily, weekly and monthly reminders to the assigned person if the task is not completed. Once the task status become completed another automatic email is sent to the person who the task is assigned to and to the overall owner f the operation to tell them it is done.

This has saved us many many ,an hours and until 2 months ago I did not even know what sharepoint was!!

What a powerful business tool!! Im trying to use it for everything now.

IB United Kingdom | Reply

4/30/2009 12:32:14 PM #

Thanks a lot!!

Ashok India | Reply

6/10/2009 4:51:01 AM #

Hi, IB, could you sketch how the workflow is designed. I have the same problem with Matt.
The workflow working fine with unit event. But when event is recurrent, the origianl [Start Date] is taken to run the workflow instead of recurring "Start date". As a result, the pausing minutes will all be 0:00 for the future recurrent events

Thanks,
Wen-Yuan

Wen-Yuan Taiwan | Reply

6/10/2009 7:10:39 AM #

Can anyone help me explain the way it is implemented from the scratch as i m new to it.

I have to send reminder emails for a sharepoint calendar event 2 weeks prior to the occurance of the event using moss. How can it be implemented?

prats India | Reply

6/11/2009 1:05:37 PM #

I have same problem with Matt. Are there solutions? Thanks a lot!

Wen-Yuan Taiwan | Reply

7/20/2009 6:59:23 AM #

Good post......This blog will helpful to all the designers, thank you .

online poker United States | Reply

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About Oscar

Oscar Medina - SharePoint Solutions Architect

I am a SharePoint Solutions Architect and Managing Partner at SharePointAce Consulting Group, LLC.  I have over 13 years of software development experience. 

Previously a Consultant at Microsoft Consulting Services (MCS) North West Region with focus on the SharePoint Products and Technologies Platform.  I have been involved with SharePoint since it's first version (SharePoint 2001) and have grown more gray hair providing solutions ever since :)

Author of the CQWP – Recurring Calendar Events at http://cqwprce.codeplex.com

 

Follow SharePointAce on Twitter! Follow me on Twitter.


Contributor to the book:

 

Occasional Speaker at SharePoint Saturday - SharePoint Saturday

RecentComments

Comment RSS