Can we set a password to PDF/EXCEL using Script

Sanjay16
Kilo Contributor

I have a requirement. On an incident form, i need a UI action button.If Someone clicks on that button, the current record should be download in PDF/Excel Format with password protection. Remember that Password protection is the Priority. Can we achieve this? If Yes, How?

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Sanjay,

you can download it as plain-pdf; not sure whether it can password protected

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Sanjay,

Is this answered?

if my answer helped you, kindly mark it as Correct & 👍Helpful so that it does not appear in unanswered list & close the thread.

Regards
Ankur

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

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hello Sanjay,

You may find below thread helpful (Password protection).

https://community.servicenow.com/community?id=community_question&sys_id=ba975fb3dbd76b405d782183ca96...

 

- Pradeep Sharma

 

Indrajit
Mega Guru

Hey Sanjay,

you can try the link that @pradeep shared and also try below code to create a PDF of current record

UI Action

Client checkbox - true

Onclick - pdfLoad()

script - 

function pdfLoad(){

var sysparm_query = "sys_idIN" + g_form.getUniqueValue();
var sysparm_view = "default";

var dialog = new GwtPollDialog('incident', sysparm_query, 1, sysparm_view, 'unload_pdf');
dialog.execute();

}

 

kindly mark Correct and Helpful if applicable.

Regards,

Indrajit.