Calculated date does not trigger workflow when created using SharePoint Designer

I was recently creating an improved content review workflow using SharePoint Designer.

The scenario was that I wanted to send the author of the document an email 2 weeks before the review deadline and then another once the review date had arrived.

I setup 3 site columns:

  • AuthoredBy – People / Group
  • ReviewDate – Date and Time (Date Only)
  • ReviewDateWarning – Calculated Field of Review Date – 14 (14 days / 2 weeks)  (See below)

image

Once the 3 columns were created I then opened up SharePoint Designer to start creating the workflow.

image

At first I thought my workflow was failing (and rightly so) because my condition was set to ‘to equal’ when it should have been set to ‘to equal (ignoring time). I changed this hoping that this was the problem so now my workflow looks like this:

image

Still no joy! When the workflow was triggered it just stated ‘waiting for DateReviewWarning’ even though the date was set to today's date. The picture below shows that the calculation of the date review working as expected but for some reason SharePoint does not see the calculated date as a native date field. When I replaced the field with the actual DateReview field and set this to today's date the workflow worked like a dream.

image

Unlike most of my blogs I didn’t find a fix to this but thought it was worth sharing the frustration I had when recently trying to implement this.

I’d be interested to hear from the SharePoint community on if other have managed to work round this (and I’m sure they have!).

4 comments:

Unknown said...

Hi Paul, I came across this post when searching for information on this issue but I managed to get this to work using the method shown here

http://www.documentmanagementworkflowinfo.com/sample-sharepoint-workflows/4-ways-set-date-value-sharepoint-designer-workflow.htm

For some reason, you need to do your date calculations within SharePoint Designer when creating the workflow, instead of using calculated columns. Store the date calculations in a workflow variable, and the workflow then triggers as expected.

At first glance it looks like SharePoint Designer only allows you to ADD to dates, but in fact you can add negative numbers in order to subtract (very Microsoft). In my case I needed to trigger the workflow 30 days before a date stored in a list column, so I added -30 days to my list column date and stored this in a workflow variable.

Hope this helps you, and anyone else struggling with this!

Anonymous said...

Hi, QQ:
I have a table with scheduled review dates defined. I want to know how can I do the following in a SPD 2007 workflow: I want to check the start date I'm collecting in InfoPath form and check against my scheduled review dates. If the start date is than the first review date then it jumps to the next review date, store that data and post it on an email

Paul Grimley said...

@Anon - It's been a while since I've played with SPD2007 however from experience this should be achievable. The InfoPath date needs to be a column in SharePoint so you can compare values with predefined dates. As regards the review date and moving to the next date this is purely another step that needs to be carried out following the previous criteria being met.

Anonymous said...

We still have the same problem in SPD 2013. SPD do not trigger on a calculated column. Thanks scottishagriculturalcollege for the solution. -30 days to a date column as variabel.

Post a Comment