Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. 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.

5 REPLIES 5

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

Ankur Bawiskar
Tera Patron

@Sara Lee2 

is it a duration field? or data/time field?

share screenshots of form and how it's showing currently and how you want it?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

The fields are Time (GlideTime) fields.

@Sara Lee2 

I don't think your requirement is feasible

💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 10x ServiceNow MVP  ||  ✨ ServiceNow Community Leader