‎10-15-2016 01:55 AM
Hi All,
How to we download all the attachments from SYS_Attachment table?
‎10-15-2016 02:04 AM
I don't think you can. But you can try to retrieve it from doc table.
When you store an attachment to any table, a record is created in the sys_attachment table that contains attachment metadata, and the file data is stored in the sys_attachment_doc table, in 4k chunks. For example, if you attach a 12k file called My_attachment.pdf, then you would have a sys_attachment entry with 3 related sys_attachment_doc entries
‎10-15-2016 02:29 AM
Hi Deep,
I have a requirement to download all the attachment at once
‎10-15-2016 02:37 AM
Service-Now do not save attachment in a single table. Meta data in sys_attachemnt and actual data in sys_attachment_doc table.
If you click on a attachment in sys_attachement, it pull that data from Doc table.
You can't download from Doc table as the data here store in chunk not fully.
What is you requirement?
‎10-15-2016 06:14 AM
Hi Mohammed,
As pointed out earlier, ServiceNow stores attachment in two tables
1) Metadata resides in sys_attachment
2) Content gets splitted in 4K bytes of data into sys_attachment_doc table for single attachment.
If you want to transfer the attachment to other systems, you have to transfer in base64 encoded format. You can try the attachment APIs of ServiceNow
If you want to download all the attachments assocaited with any record, then ServiceNowGuru provided solution will work for you