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

Updating Timestamp Fields Using Robust Transform from Excel

rokey
Tera Contributor

Hello ,

 

How do I update timestamp fields using an Robust transform as per the Excel sheet?

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@rokey 

so what did you start and where are you stuck?

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

Actually, I tried to update the timestamp fields and used both 'onAfter' and 'onBefore' scripts in the robust transform, but the timestamps are still updating as today's date.
 
    target.setValue("sys_created_by", source.u_sys_created_by);
    target.setValue("sys_created_on", source.u_sys_created_on);
    target.setValue("sys_updated_by", source.u_sys_updated_by);
    target.setValue("sys_updated_on", source.u_updated);
    target.autoSysFields(false);
    target.update();

@rokey 

not recommended to set OOTB system date/time fields during transformation

Do Not Target System Fields (sys_created_on, sys_domain etc) in Field Maps in Transform Maps 

💡 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