We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

PDF Generation

manju12
Tera Expert

Hi Team,

 

How to generate the PDF form in FSO related concept.  Please help me out 

 

Thanks,

Manju

7 REPLIES 7

Aditya_hublikar
Mega Sage

Hello @manju12 ,

 

Earlier i also tried ,custom pdf (UI Action) scenario  on incident table,  its code is as follow:

 

var v = new sn_pdfgeneratorutils.PDFGenerationAPI;

 (Option) get HTML from the description field of an incident record
var gr = new GlideRecord("incident");
var html;

if (gr.get(current.sys_id
)) {
    html = "Description:" + gr.description.toString();
    html += "\nShort Description:" + gr.short_description.toString();
    html += "\nNumber:" + gr.number.toString();
    html += "\nPriority:" + gr.getDisplayValue('priority');
    html += "\n Assignment Group:" + gr.getDisplayValue('assignment_group');
    html += "\n Assige to:" + gr.getDisplayValue('assigned_to');
}

var result = v.convertToPDF(html, "incident", current.sys_id, "myPDF");
gs.info(JSON.stringify(result));
if (result) {
    action.setRedirectURL(current);
}
 
 
 
 
If this helps you then mark it as helpful and accept as solution.
Regards,
Aditya

Hello @manju12 ,

 

I hope you are doing well. Does my response helps ?

 

If my response helps you then mark it as helpful and accept as solution.

Regards,

Aditya

ben_hollifield
Tera Guru

Hi @manju12  - the comments above are correct in that you can build this as a custom solution - the building blocks exist in-platform. If you need a turn-key solution with more flexibility, Yansa Labs offers a certified ServiceNow Store app that facilitates the creation of templates, the merging of record data, and the generation/attachment of a PDF to a record. It includes both a Flow Action as well as an interactive UI for when technicians need to generate on-demand or customize before attachment. If it's useful, it's free to trial at the link below. Feel free to reach out to me directly if we can help!