2

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.

  • I think you could create a Date/Time variable and just not set it, then assign the column to that variable. – Mike Jan 3 '18 at 15:00
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

  • 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 '18 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 '18 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 '18 at 13:54
  • Ah makes sense. I've added a picture for clarity in my orginal post :) – Morten K Jan 3 '18 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 '18 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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