How can I add records to sys_attachment table?????

crazytechie0112
Kilo Contributor

Dear All,

How can I add records to sys_attachment table????? I mean i want to upload some attachments in   sys_attachment table,i am not able to do that as there is no new button

Thank you

2 REPLIES 2

gauravchoudhury
Tera Guru

Hi,



Basically, ServiceNow stores attachment meta-data information in sys_attachment table. Actual data of the attachment is chunked and stored in sys_attachment_doc table.



If you attach a file to say an incident, it will be stored there along with a pointer back to the incident table and the sys_id of the incident.



I would recommend you to use OOB methods to create attachments than creating direct records.



You might find below thread useful,



AttachmentCreator SOAP Web Service - ServiceNow Wiki


Rajesh Mushke
Mega Sage
Mega Sage

Hello,



You can upload attachment in sys_attachment table and then create a before business rule on incident table to copy attachment from sys_attachment table to incident table with the help of GlideSysAttachment.copy


More info here Copy Attachments from Record to Record - ServiceNow Wiki


Auto-attaching attachment to a record




Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke