How to download all attachments from a table

shawna_gerard
Kilo Contributor

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?

1 ACCEPTED SOLUTION

Hi @shawna.gerard ,

 

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:

find_real_file.png

 

Thanks & Regards,

Rishabh Jha

Aavenir (http://www.aavenir.com/)

View solution in original post

13 REPLIES 13

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

Hi,

I haven't tested it, but reading quickly through what Mark wrote, you also need to create the processor yourself, not only the UI Action. Have you done that?

//Gƶran
Feel free to connect:
LinkedIn
Subscribe to my YouTube Channel
or look at my Book: The Witch Doctor's Guide To ServiceNow

Yes. but it gives me a

The page you are looking for could not be found

error.

I am on the New York release, so I believe that new Processors are no longer supported? I did find an out of the box download all attachments processor though. Now I just need it to download from a list instead of individual records. 

Rishabh Jha
Mega Guru

Hi @shawna.gerard ,

Create a UI action on your table, and add the line below to the script:

gs.setRedirect('/download_all_attachments.do?sysparm_sys_id='+current.sys_id);




find_real_file.png

 

Thanks & Regards,

Rishabh Jha

Aavenir (http://www.aavenir.com/)