
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2019 02:10 AM
When we have a 'File Attachment' type field in a table, and we attach a file in that table's form for that field; where are the attachments saved?
As in, in which table are the field's attachment records saved?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2019 02:22 AM
Hi Pranshu,
all attachments are stored in sys_attachment table and metadata for that attachment is stored in sys_attachment_doc
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2019 02:18 AM
Hi
There is a table named sys_attachment where you will find the attachments.
Regards,
Omkar Mone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2019 02:22 AM
Hi Pranshu,
all attachments are stored in sys_attachment table and metadata for that attachment is stored in sys_attachment_doc
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 01:36 PM
I am attaching some files directly to the record, and other files to file attachment fields, i found discovering these fields in the table to be a little different
To the Record:
Table name: x_my_table Table sys ID: sys_id_of_record_attachement_is_on
To the field: ZZ_YYx_my_table Table sys ID: sys_id_of_record_attachement_is_on
For whatever reason the way SN differentiates them is by adding a ZZ_YY to the table name, there may be more variations than this
if you have multiple attachment fields I suggest making sure you have a very unique file name, and searching by the to find how SN is changing that table name field for each one
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2019 02:24 AM
Hello Pranshu,
once you upload an attachment in SNOW, a record(s) in two tables are created:
- sys_attachment
- sys_attachment_doc
Basically, (1) contains meta data about your attachment (from where it came, who created it, how large it is...) and the (2) table stores your actual attachment data split in 4K chunks, so if your attachemnt is larger, you will end with multiple records here. Also, important note, each record related to one particular attachment in sys_attachment_doc has its position (eg. first, second, third...), so your attachment can be retrieved in desired order once you query it.
See also https://snprotips.com/blog/2016/2/25/understanding-and-using-glideattachment for more details.