How to set a Date/DateTime field to empty in an expression

Version 1

    Details

    How to set a Date/DateTime field to empty in an expression.   Once a date / datetime field has a value set (ie 12/12/2016)  it is not possible to set it to "00/00/0000", this does not clear the value (set it back to empty).


    Resolution

    Use null to empty the date/datetime field.   


    The following expression sets the incident.ResolvedDateTime to a value if the status is resolved or closed.  If the status is active or logged then the ResolvedDateTime is set to empty using the null operator.

    $(if Status == "Resolved"

      then if ResolvedDateTime > CreatedDateTime

           then ResolvedDateTime

           else CurrentDateTime()

      else if Status == "Closed" then ResolvedDateTime else null)