Archive attachment is working but not showing on the ar_custom_table record

UTSAV KUMAR JAI
Tera Contributor

Hello Everyone,

 

Currently, I am archiving incident records along with their attachments.
Once the archiving process is complete, I am able to see both the record details and the attachments in the ar_incident table.

 

UTSAVKUMARJAI_0-1775815675241.png

 

UTSAVKUMARJAI_1-1775815853638.png

 

When I perform the same process on any custom table, after archiving the record, I do not see the attachment in the corresponding ar_custom_table archive table.

 

What could be the root cause of this issue?

 

Thanks in advance,
Utsav





1 REPLY 1

Naveen20
ServiceNow Employee

 

For OOTB tables like Incident, ServiceNow ships pre-configured Archive Related Records entries that tell the archiver to also move sys_attachment and sys_attachment_doc rows associated with the parent record. You can see that tab at the bottom of your Archive Rule form in Image 1. For a custom table, these entries don't get created automatically — you have to add them yourself.

Here's what to do on your custom table's Archive Rule:

Go to the Archive Related Records related list and add two entries:

  1. For sys_attachment — set the Reference field to table_sys_id, Reference table to your custom table name (e.g., u_custom_table), and Action to "Archive."

  2. For sys_attachment_doc — this one is a child of sys_attachment, so you'd add it referencing sys_attachment to ensure the actual binary chunks (stored in sys_attachment_doc) follow the attachment header record into the archive.

Without these entries, the archiver moves the parent record to ar_u_custom_table but has no instruction to also move the related attachment records, so they either stay in the live sys_attachment table (orphaned) or simply don't appear in the archive view.

You can verify by checking the Incident archive rule's related records tab — you'll see those sys_attachment / sys_attachment_doc entries already present there as a reference for what to replicate on your custom table.