- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2021 08:42 PM
How to copy attachment from sys_attachment table to a field of file attachment type in a custom table.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2021 01:05 AM
Hi,
then the same script can be used to update the attachment field
var att = new GlideRecord('sys_attachment');
att.addQuery('table_sys_id', current.sys_id);
att.query();
if(att.next()){
current.attachment_fieldName = att.sys_id;
current.setWorkflow(false);
current.update();
}
Regards
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
‎03-04-2021 02:00 AM
Hi,
So is there attachment record attached to current record by the time the after BR runs?
how and from where you are adding file to this record?
Regards
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
‎03-04-2021 02:12 AM
Thanks Ankur.its working. Actually i have created two BR for these.Now I added this script to the BR for automatic attachment of pdf. Now its working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2023 01:37 AM
Hi @Ankur Bawiskar if i add a attachment in incident form need to automatically a checkbox is checked as true how can I do this? help me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2025 04:08 AM
Hi @Ankur Bawiskar
I have a similar requirement like this but I need to copy the attachment to the record. How can do that? I'm using record producer and it has reference field which have attachments. I need to attach the attachment from the reference table to the record which is generating from Record producer. I'm using below script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2025 04:27 AM
can you post a new question and share all the details as this is an old thread?
Tag me there
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader