Transform map - mapping of u_sys_created_on to target table sys_created_on
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2025 01:11 AM
I have requirement where i have to map source .sys_created_on from the import set table to the target table
I have tried it by field mapping - but after checking it by running the transform map it is showing as empty
so i have written a script - ON Before Script -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2025 01:58 AM
what does the source file contain?
what error you are getting after data load? is the data not getting reflected on those 2 tables?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2025 03:06 AM
You’re trying to set the system fields sys_created_on and sys_updated_on on the target table during an import via Transform Map, but these fields are read-only by default in ServiceNow, and cannot be modified using direct assignment (even in transform scripts).
You need to disable auto-setting of system fields using this setting:
In the Transform Map:
Add the following in a “OnBefore” transform script:
target.setWorkflow(false); // Disables business rules
target.autoSysFields(false); // Allows writing to sys_created_on, sys_updated_on
target.sys_created_on = new GlideDateTime(source.u_sys_created_on);
target.sys_created_by = source.u_sys_created_by;
target.sys_updated_on = new GlideDateTime(source.u_sys_updated_on);
target.sys_updated_by = source.u_sys_updated_by;