Export Assessment User Responses in to PDF

Lokesh5
Tera Contributor

Hi Everyone, Kindly help me in exporting the user responses in to PDF. I need a button to export the User responses OOB UI  page(assessment_take2) into PDF.

 

4 REPLIES 4

Amit Verma
Kilo Patron
Kilo Patron

Hi @Lokesh5 

 

You can create a UI action to achieve this. Refer below post and give it a try :

https://www.servicenow.com/community/developer-forum/generate-pdf-from-ui-action/m-p/1457260/page/3

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Hi @Lokesh5 

 

You can create an UI Action to fulfill this requirement. Please have a look and try for your requirement. Below script can be used:

 

function generatePDF(){
var view = 'pdf_view';

var url = '/' + g_form.getTableName() + '.do?sys_id=' + g_form.getUniqueValue() + '&sysparm_view=' + view + '&sysparm_media=print' ;
window.open(url,"_blank");

}

 

********************************************************************************************************
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.

********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect


Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************

Anand Kumar P
Giga Patron
Giga Patron

Hi @Lokesh5 ,

yes you can generate the PDF using client side UI action

check if this helps you; it would show UI action for user to download the PDF of the record

UI action steps

Client - checkbox True

OnClick - generatePDF()

Form Button - True

Form context menu - True

Script:

function generatePDF(){
	
	var url = '/' + g_form.getTableName() + '.do?sys_id=' + g_form.getUniqueValue() + '&PDF';
	window.open(url,"_blank");
	
}

Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Lokesh5 

 

What is use case here. It will be a customization. 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************