Tuesday, October 13, 2009

SharePoint Designer Workflows: How to check for blank values

Pre SP2, if a datetime field was blank, the value would be ?????. This made checking for blank fields simple; you create a workflow variable and created a condition "if variable:datetime field equals ?????". There are tons of blog posts that go into detail about this (http://www.bing.com/search?q=sharepoint+designer+workflow+blank+date+fields&form=QBRE&qs=n)

However, SP2 makes a change to how blank fields are stored, though it is not documented in the KB article.
If you have a workflow using the pre-SP2 logic, you will find that the value of your workflow variable is now blank. To fix this, simply change the condition from "if variable:datetime equals ?????" to "if variable:datetime is empty".

No comments:

Post a Comment