- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-16-2020 06:33 AM
I have a requirement to download all attachments on a table from a button. I have tried using a UI Action and Processor, via this link
https://www.servicenowguru.com/scripting/download-attachments-zip-file/#comment-34336
But It cannot find the Processor. I believe I read that it is deprecated now as I am in New York.
Does anyone have a current solution to this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-16-2020 01:54 PM
Hi
I got it working as a list UI action on incident table. You'll get one zip for each sys_id passed.
Below is the UI action script:
function downloadAll() {
selSysIds = g_list.getChecked();
sysIdList = selSysIds.split(',');
for (var i=0;i<=sysIdList.length;i++)
{
window.open('/download_all_attachments.do?sysparm_sys_id='+sysIdList[i],"_blank");
}
}
Here's the UI Action screenshot for the setting that I had used:
Thanks & Regards,
Rishabh Jha
Aavenir (http://www.aavenir.com/)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-16-2020 12:30 PM
Thank you for the reply.
I set up everything, but the attachments won't download. This is my script include. It is passing the list of sys_id's correctly, but it seems the download doesn't want to work. I also tried looping the list and that did not work either.
var DownloadAttachments = Class.create();
DownloadAttachments.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
download: function() {
var list = this.getParameter('sysparm_list');
gs.setRedirect('download_all_attachments.do?sysparm_sys_id=' + list);
return 'this worked';
},
type: 'DownloadAttachments'
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-16-2020 01:54 PM
Hi
I got it working as a list UI action on incident table. You'll get one zip for each sys_id passed.
Below is the UI action script:
function downloadAll() {
selSysIds = g_list.getChecked();
sysIdList = selSysIds.split(',');
for (var i=0;i<=sysIdList.length;i++)
{
window.open('/download_all_attachments.do?sysparm_sys_id='+sysIdList[i],"_blank");
}
}
Here's the UI Action screenshot for the setting that I had used:
Thanks & Regards,
Rishabh Jha
Aavenir (http://www.aavenir.com/)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-17-2020 06:35 AM
Hi
Hope you're doing well.
Please mark the answer as helpful/correct if it has helped you solving your problem, and to close this thread, so that the other community members can refer to it as a resolved thread.
Thanks & Regards,
Rishabh Jha
Aavenir (http://www.aavenir.com/)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-16-2020 07:52 AM
Please take a look at this thread.
Please mark my response as correct and helpful if it helped solved your question.
-Thanks