Trouble setting Date/Time field with GlideDateTime in Transform Map Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi all,
I’m working on a data import in ServiceNow and I’m having issues updating a Date/Time field (u_due_date) using a field script in a Transform Map. My goal is to convert a date string from the import set to a valid Date/Time value in the target table.
Here’s my current script in the field map:
2025-11-18 14:30:00 (as a string in the import set)
The u_due_date field is not being updated after the transform runs—no errors, but the value isn’t set in the target record.
What I’ve checked:
- The field is of type Date/Time.
- The source data string matches the expected format (YYYY-MM-DD HH:mm:ss).
- No errors in the logs.
Question:
What am I missing or doing wrong when converting and returning a GlideDateTime in a Transform Map field script? Is there a better or safer way to do this conversion so the field is reliably updated?
Thanks in advance for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
if the incoming value is having this format YYYY-MM-DD HH:mm:ss then no scripting required.
simply set this as Date format and it will get populated
Clear the source script and uncheck the "Use source script" field
Note: ensure there is no business rule etc which is clearing this field value
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
