How can i get attachment data in table

Lakshmi53
Tera Contributor

Hi All,

 

My requirement is, once user attached the attachment and RITM submitted i need to add attachment data custom table. how can i develop import set and transform map for this.

2 REPLIES 2

Bert_c1
Kilo Patron

the sc_req_item table contains the requested items records. And the attachments are stored in sys_attachment, and the sys_attachment_doc table (I see a sys_attachment_doc_v2 table in my instance but it is empty). I do not think you want to use and import set and transform map as the data resides in the instance database.  A Business Rule can be defined on the sc_req_item table, that can query the records in the attachment tables and then use the results to copy the attachment to the custom table.

 

You can query the sys_attachment table using the 'table_name' and 'table_sys_id' with 'sc_req_item' and the sys_id of the record that was created/updated in the sc_req_item table.

You can query sys_attachment_doc using the 'sys_attachment' field containing the sys_id of the sys_attachment record.

Some references:

https://docs.servicenow.com/bundle/tokyo-application-development/page/script/business-rules/concept/...

 

https://docs.servicenow.com/bundle/rome-application-development/page/script/business-rules/concept/b...

 

Bert_c1
Kilo Patron