The CreatorCon Call for Content is officially open! Get started here.

generate a pdf of selected fields in a form using ui action

marrikruthi
Tera Contributor

 

var inc = current.number;
 
var pdfGenarator = new sn_pdfgeneratorutils.PDFGenerationAPI();
 
var pdfResult = pdfGenarator.convertToPDFWithHeaderFooter(inc, 'incident', current.sys_id, current.number + ' Number PDF');
 
if (pdfResult) {
    action.setRedirectURL('https://dev225695.service-now.com/sys_attachment.do?sys_id=' + pdfResult.attachment_id);
 
}

this script showing only field

Does anyone know how to modify the previous code to only include certain multiple fields?

Or alternatively how to create a pdf with only certain values.

7 REPLIES 7

@marrikruthi ,

Then in that case, Can you elaborate a bit more to get a better understanding of your requirement?

 

Regards,

Shubham

@ShubhamGarg 

marrikruthi_0-1723109794125.png

i want to download particular fields in a form into pdf document when i click on ui button

Mark Manders
Mega Patron

Please close this one and follow up here, by also adding what solution you already tried and what the results were, making you say 'it didn't work'
https://www.servicenow.com/community/developer-forum/add-two-more-fields-to-the-script/td-p/3013745

 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark