How to pre populate attachment variable inside record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
I create a Record Producer and one of the variables is of type Attachment. I would like to pre populate this variable with a pdf file and to have a digital signature underneath, is it possible ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
Yes this is possible by specifying the sys_id of the sys_attachment record as the default value for the variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Alon Grod
Yes, it is technically feasible. You just need to create a onload client script and script include , write this function.
populatePdf: function() {
var SysId = this.getParameter('<sys_id of record>');
var attachPDFSysId = "";
var grAttachment = new GlideRecord('sys_attachment');
grAttachment.addQuery('table_name', '<table_name');
grAttachment.addQuery('table_sys_id', SysId);
grAttachment.query();
if (grAttachment.next()) {
attachPDFSysId = grAttachment.sys_id.toString();
}
return attachPDFSysId;
}
Note: For adding digital signature , you need to add additional script.
Refer:
Digital signature for PDF documents using CAC or PIV smart cards
How to add Digital Signature in PDF through Script
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti