3

It seems to me that for some utterly stupid reason, it seems as though one cannot clear a date time field using a workflow, although one can clear it manually in the user interface. Makes absolutely no sense. I have tried creating a date and time field (empty date) with a default value of none that always stays empty, and I assign it to a workflow variable, and use that variable to assign a value to a date time field on another list. It does absolutely nothing. Workflow works, no errors, does everything else but it simply ignores the empty value that I am trying to set it with and keeps the existing value in that field as if nothing happened at all. Log messages to workflow history tell me the logic is correct and I get to the spot where I should be, but it just quietly does nothing. No errors.

I tried using duplicate date fields that are calculated columns returning a string and get their value from the original date field, so that maybe I can use strings for display on the other list instead of dates and it will let me clear the string version of the date but the calculation just converts it into a long number. I could format it to show as date time format in SharePoint, but the list that the workflow is setting values on is meant to be exported as an excel spreadsheet, so I don't know if that column formatting will stick when it's in excel and whether I'll instead get the long number again.

It seems to me that Microsoft in their infinite wisdom has successfully made what I want to do impossible. And why? Again, you can clear it in the UI no problem, so it's not like it can't be done. It's just one of those many completely annoying botches they always seem to make for completely unexplainable reasons.

Has anyone else had success doing this using 2013 workflow on SharePoint online 2016? If so, please share. Thank you.

1
  • I think you could create a Date/Time variable and just not set it, then assign the column to that variable.
    – Mike
    Jan 3, 2018 at 15:00

3 Answers 3

2

I got this to work, but you have to be sure to use a 2010 workflow, not 2013 workflow. The 2013 version does not allow entering 01/01/0001 as a date, only 2010 can do that.

1

Yup - even if the approach is just as stupid as leaving out a native way to do it:

  1. Create a Workflow Variable named “Empty Date”
  2. Use the Dynamic String Builder to set “Empty Date” to 1/01/0001
  3. Use the Set Field in Current Item action to set your Date field to the Workflow Variable “Empty Date”
  4. Rejoice!

Found the solution here just a few days ago: http://appdevonsharepoint.com/blanking-out-a-date-field-via-sharepoint-designer-workflow/

Edit:

Added picture for clarity. enter image description here

6
  • The values that are being set on the other list are dates, so I don't think this will work. If I could just use strings, life would be easy
    – Bobh
    Jan 3, 2018 at 13:33
  • This does work for date fields. I've used it several times since I found it. The trick is to set the date as 1/01/0001 - which you can't in the date picker. But if you set a string to that value and then set the date field to the string everything works as "intented".
    – Morten K
    Jan 3, 2018 at 13:46
  • I couldn't do that using the regular entry for the value, and I didn't notice that you said use the string builder. When i used that, the value stuck. When i used normal entry, the value would just revert back to "value". Let me try it from here. thx.
    – Bobh
    Jan 3, 2018 at 13:54
  • Ah makes sense. I've added a picture for clarity in my orginal post :)
    – Morten K
    Jan 3, 2018 at 14:01
  • I get a compile error as I expected and it tells me "Argument 'blank' is of type System.String and the expected type is System.DateTime." So it's complaining that I am trying to write a string value from my variable to a date and time field on the other list as i would expect
    – Bobh
    Jan 3, 2018 at 14:09
1

With Microsoft's retirement of 2010 workflows, I replaced my 2010 workflow with a PowerAutomate (Flow). I was able to set the date field to null as per the picture below:

Set date field to null

Your Answer

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

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