1

I am working on SharePoint server 2013, and i create a new Workflow 2010 inside Sharepoint designer 2013. now inside the Workflow i set an email which contain the following value:-

[%Current Item:Contract Review Date%]

now if the "Contract Review Date" value is empty , the email will contain the following value 01/01/0001instead of showing empty string. So can anyone advice how to fix this problem.

I mean how to allow if the contract review date is empty then to show empty string inside the email, instead of 01/01/0001?

2
  • The Contract Review Date column is of type Date/Time. Does the column have a default value?
    – Submits
    Commented Jun 1, 2016 at 12:50
  • @Submits Contract review date is of type Date ,, and it does not have a default value. also when i view/edit a list item the value will be empty.. but not sure why inside the workflow it will show 01/01/001
    – John John
    Commented Jun 1, 2016 at 12:56

5 Answers 5

1

Create a new variable, ReviewDateForEmail of type string.

Run a check,

If [%Current Item:Contract Review Date%] is not equal to 01/01/0001
Set ReviewDateForEmail to [%Current Item:Contract Review Date%]
(if desired)
Else Set ReviewDateForEmail to There is no set review date for this item.

In your email, use the ReviewDateForEmail. This will result in either the contract review date, or an empty string, or a fixed string if desired..

2
  • but is there a way to set the ReviewDateForEmail to be empty string inside of "There is no set review date for this item" ??
    – John John
    Commented Jun 1, 2016 at 13:06
  • @Erix now i can not define this inside the workflow designer 01/01/0001 !!! did you try it your self ? also the real value will be 01/01/0001 00:00:00 even if the field of type Date only
    – John John
    Commented Jun 1, 2016 at 13:10
4

Date fields are never truly empty, so the option doesn't exist. An "empty" date field is actually set to 1/1/0001.

So for your specific project, forget the whole "storing the string values of the dates" thing, that won't work. Instead, set up the workflow to perform the action if Date field is greater than 1/1/0001.

8
  • thanks for your reply. but in my case i still want to send the email even if the contract review date is empty.. but i want its value to be empty inside the email..
    – John John
    Commented Jun 1, 2016 at 13:04
  • Yes you can as you need to change the condition that if it is not greater than 1/1/0001 than you can pass empty string.
    – Hardik
    Commented Jun 1, 2016 at 13:06
  • i am unable to check if the contract review date is greater than 1/1/0001 .. as on the date value selector the minimum value will be 1601 ... not sure how simple thing can go crazy inside sharepoint ... can you advice ?
    – John John
    Commented Jun 1, 2016 at 13:12
  • There is a small workaround given here....howardmcd.wordpress.com/2013/05/20/…
    – Hardik
    Commented Jun 1, 2016 at 13:17
  • so all these workarounds just to show the date field correctly inside the email.. you know i will remove this field from the email...
    – John John
    Commented Jun 1, 2016 at 13:19
1

Create an initiation variable of type string and don't set a default value. Before you write Contract Review Date to your email, use an if statement to check if the date is greater than 1/1/1900. If it is, use the date... if not, use the null variable.

1

Create a local variable of type date/time. Do not assign any value.

if condition : If [Contract review Date] is equal to [Local Variable]. 

This should work for your condition to be working.

1
  • Monica - that doesn't work for me. When I set up a local date/time variable, don't initialize it, in an e-mail it displays 12/31/1899 4:00:00 PM. If a Current Item date that has been left blank, in an e-mail it displays 1/1/0001 12:00:00 AM. All we are looking for is a way in an e-mail to have a local variable that either displays the current item date if not blank, or nothing if left blank. No one seems to know how to do this simple task in all the forum articles I've read, nothing suggested ever works. Why is this so difficult?
    – user61983
    Commented Nov 18, 2016 at 12:45
0

Create a calculated column (lets say 'IsBlank_CRD') in the list with formula

=IF(ISBLANK([Contract Review Date]),"Y","N")

Now in workflow check if 'IsBlank_CRD' is 'Y' or 'N' , to do the further processing in email.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.