Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

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





9 REPLIES 9

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.

Hello @Naveen20 

Thankyou for the response
As, I have configured the same way in related list

UTSAVKUMARJAI_0-1776078241726.png
Also, after the archival of the record, attachment is coming to ar_sys_attachment table and not in ar_custom_table.

Please, let me know if there is any issue on the steps

Warm Regards

Utsav 

Naveen20
ServiceNow Employee

This is actually expected behavior — your configuration is correct. Attachments are never stored inside ar_custom_table. They always go to ar_sys_attachment and ar_sys_attachment_doc, regardless of whether the parent record is OOTB or custom. That's the same for Incident too — its attachments land in ar_sys_attachment, not in ar_incident.

So if your attachments are showing up in ar_sys_attachment after archival, the archiving itself is working properly.

The real question is likely: why can't you see the attachments when viewing the archived record in ar_custom_table?

That typically comes down to how the archive record viewer resolves and displays attachments. For OOTB tables like Incident, the platform has built-in view configurations that link ar_sys_attachment records back to the archived parent and display them in the header (like you saw with INC0009009 in your first screenshot). For custom tables, that linkage in the UI may not be automatic.

A few things to check:

1. Verify the attachment record exists and is linked — Go to ar_sys_attachment.list and filter by table_name = your_custom_table and table_sys_id = the archived record's sys_id. If you find matching rows, the archive worked; it's just a display issue.

2. Check the archive view/form layout — Make sure the ar_custom_table form has the attachment display enabled (the [o] Manage Attachments header bar). Sometimes custom archive tables need their form layout configured to show the attachment icon.

3. Confirm table_name mapping — When attachments get archived, the table_name field in ar_sys_attachment should reflect the original custom table name. If it's getting set incorrectly, the viewer won't associate them.

If the records exist in ar_sys_attachment with the correct table_sys_id, your setup is working — it's just the form/UI for the archived custom table that needs adjustment to display them.

Hello @Naveen20 

Point 1
Attachment Record is showing on ar_sys_attachement table with custom table name and having the sys_id of primary record but on opening the record in form view, it is showing not actual attachment but thumb image. Please refer the screenshot-

UTSAVKUMARJAI_0-1776100676871.pngUTSAVKUMARJAI_1-1776100739451.png

Point 2
I configured the form_layout but there is no such field as "Manage Attachments" but "Attachments" field is there. On adding the Attachment field, it is showing as a form section in archive records with no details. I configured the Dictionary as well and checked if there are any records which has attributes containing attachment but there is none.

UTSAVKUMARJAI_2-1776100789146.pngUTSAVKUMARJAI_3-1776100843718.png

 



Point 3
As you mentioned, it is working as expected. When attachments get archived, the table_name field in ar_sys_attachment should reflect the original custom table name.


Note- There is no such table as ar_sys_attachment_doc in the system.

Thanks in Advance
Utsav