We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Set a time field to a NULL value

Sara Lee2
Tera Contributor

Hello experts!
I have a requirement to set a time field to NULL by default instead of our system default of "12:00:00 AM " (this is our instance's system default format).
The business need is to be able to distinguish when the time field is actually meant to be set to 12 am vs when it is 'NULL' or untouched.

1 REPLY 1

Tanushree Maiti
Tera Patron

Hi @Sara Lee2 

 

  • Use a GlideTime field if you only need to store a time of day (without a date). This avoids the ambiguity that can occur with GlideDateTime, where an "empty" value and a default date/time can be confused.
  • Remove the default value from the dictionary so that new records leave the field truly NULL until a user explicitly sets a value.
    • Right-click the label of your time field on the form and select Configure Dictionary.
    •   Navigate to the Default Value tab. 
    •   Ensure the Default value field is completely empty (do not type space, null, or None).
    • Click Update
  • Use a UI Policy (or Client Script, if needed) to control when the field is shown, hidden, mandatory, or editable based on your business logic. This helps distinguish between an untouched field (NULL) and a user intentionally selecting 12:00:00 AM (00:00:00).
Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti