I want to display the last modified date of the file before it was uploaded.

bonsai
Mega Sage

I want to upload files from a local server to an instance.

Is it possible to reflect the modification date and time of the local server file in the attachment on the instance?

The idea is to create a custom field called "Local File Modification Date and Time" in the attachment table and set the date there.

 

A user has asked if it's possible to retain the file modification timestamps on the local server.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@bonsai 

not possible because the last modified timestamp of the file is being stored in the metadata and ServiceNow can only hold the actual file in any record

Please inform your customer about this OOTB behavior and platform limitation

💡 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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@bonsai 

not possible because the last modified timestamp of the file is being stored in the metadata and ServiceNow can only hold the actual file in any record

Please inform your customer about this OOTB behavior and platform limitation

💡 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

Tanushree Maiti
Giga Patron

Hi @bonsai 

 

Though it is technically possible BUT adding custom fields to the sys_attachment table is not generally recommended in ServiceNow.

 

The sys_attachment table is a core foundation table. Modifying it can cause significant upgrade complications, performance bottlenecks, and unexpected behavior with out-of-the-box (OOB) attachment processing.

 

The sys_attachment table in ServiceNow is a core system table that stores the metadata for all files attached to records across the platform. It acts as a bridge, linking an uploaded file to the specific record (like an Incident or Change) it belongs to.

 

Hope you are not using sys_attachment ,just to store orphan files. If those attachment is related to a record like incident, I will recommend you to create custom field Local File Modification Date and Time in that Record table .

 Then either manually or using any rule ,during record insert, populate the custom field.

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

@Tanushree Maiti 

Could you please share your approach on how it's possible to capture the last modified time of any file (doc, excel, ppt etc) in the custom field on sys_attachment?

It would be helpful for community members.

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