While I was working at a pharmaceutical company, I had to generate lots of documents for compliance reasons. In some cases, I had to pull data from ServiceNow to embed them in Word documents, such as requirements, test scripts, traceability matrix, etc. Soon it became very labor intensive so I decided to automate the process using the ServiceNow ODBC driver and Microsoft Office VBA (VisualBasic for Applications, a macro language). This allowed me to extract data from ServiceNow and use them in documents; the time savings was huge.
I originally published this on Share shortly after presenting it at Knowledge 14 in San Francisco. Since then, I lost access to Share and, unfortunately, wasn't able to restore my access. So I'm republishing it here after making some revisions.
- Slide deck that was presented at K14 with instructions on how to run the samples in the Word file.
- Word macro file containing VBA samples for Word, Excel, PowerPoint, Outlook; pdf files are created by exporting Office files as pdf.
The Word demo file was created using Word 2010 but should work with later versions. Below is the abstract from the deck:
Beyond ITSM, ServiceNow is a powerful platform for any business service request management. Enhance the power by fully integrating with Microsoft Word, Excel, Outlook and PDF, from simple form-based report generation to live, interactive documents. Automatically pull contents from ServiceNow and apply formats to meet business needs. Add password protection or digital signature for enhanced security. Simple, practical do-it-yourself solutions will be demonstrated and best practices discussed. If you ever wanted more than the standard Excel and PDF export from ServiceNow, this is a must-attend session!
The slide deck includes:
- Solution – Requirements Tracker
- Solution – Overview of exporting to Word templates
- Solution – Prepare Word VBA
- Solution – Open ServiceNow Database
- Solution – Query ServiceNow Database
- Solution – Create Word Documents
- Solution – Export to PDF
- Solution – Protect Document (using Digital Signature)
- Solution – Create Excel Spreadsheets
- Solution – Create PowerPoint from Excel
- Solution – Create Outlook Email
- Alternate Solutions
- Tips – ODBC
- Tips – VBA
Hope you find it useful and please post questions if you run into anything.
Please feel free to connect, follow, post feedback / questions / comments, share, like, bookmark, endorse.