Save Record as PDF Attachment in ServiceNow
Here we provide a method we have found for exporting a ServiceNow record as a PDF file and attaching it back to the record.
In ServiceNow you often have the need to export a record as a PDF, whilst this is not necessarily difficult, occasionally you want to take this a step further and have this PDF automatically attached back onto the originating record as an attachment.
Below we outline a basic set of scripts that help you achieve this.
We start with a Server Script that uses a new custom user account to read and export the record, this record is then saved back to the originating record as an attachment.
This script requires setting up 2 system properties, a username and a password that correspond to a user account that is used to generate the PDF.
Make sure that you have a user account that matches these system properties other wise this will not work.