Export task record and all attachments to a zip file from UI action

KimK
Tera Contributor

Hi,

 

Any suggestion on how to create a UI action that export a task record (in pdf format) and all attachments on that task record to a zip file on the users desktop ?

 

Thanks.

 

Regards

Kim

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@KimK 

to download a record in PDF simply form the URL and open the URL in new tab

function downloadRecordZip() {
    var url = '/incident.do?sys_id=' + g_form.getUniqueValue() + '&PDF';
    g_navigation.open(url, '_blank');

    g_navigation.open("/download_all_attachments.do?sysparm_sys_id=" + g_form.getUniqueValue(), "_blank");
}

AnkurBawiskar_0-1717078391636.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@KimK 

to download a record in PDF simply form the URL and open the URL in new tab

function downloadRecordZip() {
    var url = '/incident.do?sys_id=' + g_form.getUniqueValue() + '&PDF';
    g_navigation.open(url, '_blank');

    g_navigation.open("/download_all_attachments.do?sysparm_sys_id=" + g_form.getUniqueValue(), "_blank");
}

AnkurBawiskar_0-1717078391636.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

KimK
Tera Contributor

Hi Ankur,

Thanks for your reply 🙂

Regards

Kim