How can I retrieve the attachment associated to a record?

philippea
ServiceNow Employee
ServiceNow Employee

Hello,

Is there a way to get the name, or sys_id of the document that is attached to a particular record?

So far I only found articles asking if there is an attachment, or about how we can attach a document, but nothing about actually getting the name of the document.

The sys_attachment table doesn't have any reference to the exact record the attachment is referred to, and the table (kb_knowledge in my case) has no reference to any field on the sys_attachment table, nor even the sys_attachment_doc table...

Thanks in advance for your inputs

Philippe

1 ACCEPTED SOLUTION

Hi Philippe,



If you go to the sys_attachment list view you can specify the table name and sys_id of the record you are interested in and all attachments to that record will be displayed.



Best Regards



Tony



For example:


Screen Shot 2015-07-27 at 10.56.07 AM.JPG


View solution in original post

5 REPLIES 5

tony_barratt
ServiceNow Employee
ServiceNow Employee

Hi Philippe,




Please refer to


fields table_name and table_sys_id in the sys_attachment table.




Best Regards




Tony


Thanks Tony,



It is very helpful!



Thanks a lot for your help!



Philippe


Hi Philippe,



If you go to the sys_attachment list view you can specify the table name and sys_id of the record you are interested in and all attachments to that record will be displayed.



Best Regards



Tony



For example:


Screen Shot 2015-07-27 at 10.56.07 AM.JPG


I'll ask bianca.vaccarini to mark this discussion as a question and then ask you to click on "Correct Answer" and/or "Helpful Answer" on the appropriate responses so other members can see you received a valid answer.