Since I originally published this, I’ve found that you can simply store the date in a dynamic string and then test the string to see if it is empty. Use the “Build Dynamic String” action.
Testing the variable to see if it is empty.
Even easier!
Here’s the original post.
I was recently teaching an Advanced SharePoint class in Richardson, TX and a student was expressing his frustration over Microsoft’s apparent oversight within the SharePoint Designer workflow wizard. One of the “IF” conditions is a simple testing of the value of a field…”If this equals that.” He wanted to test a date field in SharePoint to see if it was empty or not. Problem is, when you select a field that is typed as DATE in SharePoint Designer, there is no test for the empty or null condition. You can see this in the first figure.
It occurred to me that we might be able to change the type of the field to a string and then be able to perform the comparison. I used the “Build Dynamic String” action.
I selected the End Date custom field on my Expense Statements list and stored it in a new variable that was typed as STRING.
The results of this were not exactly what I expected, however I was able to determine, through trial and error (sending the values in an email), that the conversion created a string that was filled with question marks (????). Therefore, if you simply test to see if the new string begins with a ?, you can successfully test for an empty date value.
Both my student and I were happy with the results.
Sharepoint Designer 2007 does not list “Store” in Workflow Designer – Workflow Actions – Choose an Action drop-down box on my system. I am trying to add workflow to a customized Help Desk app template sites Service Requests list on a WSS 3.0 Intranet site I’ve developed here. Have you installed any add-on that provides you with that specific action as an option? Thanks – Alan
Use the “Build a Dynamic String” action. That will get you the “store” function that you see in the pics. Russ.
Hello,
i am trying to check two date fields in one single workflow and at least one of them would have a value in that field. So I was trying to store two of the dte fields in two different variables and compare them using is empty, but doing either one works but doing them both doesn’t work… any thoughts?
Thank you in advance.
Sharmin
How can you do this in sharepoint 2010? I can’t find this function.
Thank you in advance.
Henk
fantastic… thanks mate.. you are a gem!!
Russ,
Thank you very much. Exactly what I need for tomorrow’s project.