How to Generate PDF Documention of incident record created by user
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 04:37 AM
How to generate pdf documentation of particuler incident record created by user
STEP's
Step 1: Create a custom action in flow designer and add script
inputs: 1 -> sys_id
2 -> table
3 -> Attachment name
script :
⬇️⬇️
(function execute(inputs, outputs) {
// ... code ...
var v = new sn_pdfgeneratorutils.PDFGenerationAPI;
// (Option) get HTML from the description field of an incident record
var gr = new GlideRecord(inputs.table);//Table name -----Access table name from flow input
var html;
if (gr.get(inputs.id)) { //
html="Number :"+gr.number.toString()+"\n"+"Caller Name : "+gr.caller_id.toString()+"\n"+"Short Description : "+gr.short_description.toString()+"\n"+"Description :"+gr.description.toString();
//html = gr.description.toString();
}
var result = v.convertToPDF(html, inputs.table, inputs.id, inputs.name);
gs.info(JSON.stringify(result));
})(inputs, outputs);
save and publish
Step 2 : -
-- Create a flow and trigger from incident(you can use own table according to requirement) table
-- Add custom action in flow
Step 3 : Create new incident record
Step 4: Attachment automatically Add after new incident create
⬇️
1 REPLY 1
Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2025 11:47 PM - edited 05-06-2025 12:01 AM
Hi @ajay98 , what value do you provide as action input in name?
I am trying to get the attachment and sent it out as notification within the flow.
Is there a way we can omit the part where the attachment is attached to the incident??