How to use ExcelJS in Scheduled Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2024 08:35 AM
I'm trying to create a report that is formatted into table with a couple of worsheets in an excel workbook and found a post where someone suggested using ExcelJS.
Being new to JavaScript and ServiceNow, I'd like to know... Is it possible to include ExcelJS in a newly created script that I'm creating via selecting "All > System Definition > Scheduled Jobs > New > Select Automatically run a script of your choosing".
If so, how do I make ExcelJS accessible to the new scheduled script I'm creating?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2024 11:29 AM
Maybe a better question is... Where do you load the npm packages in ServiceNow so they can be used in a JavaScript include statement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hello @Renee-17 ,
Have you managed to somehow run ExcelJS via scheduled jobs?
I need to send periodic reports with customizations, but I haven't found a solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2025 01:43 PM
any update guys?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2025 04:14 PM
Unfortunately, you cannot directly include ExcelJS (or most external JavaScript libraries) in ServiceNow scheduled scripts in the traditional way you might expect. Here's why and what you can do instead:
Why ExcelJS Won't Work Directly
ServiceNow runs on a server-side Rhino JavaScript engine that doesn't support:
NPM package imports
Modern ES6+ module syntax (import/require)
Many Node.js-specific APIs that ExcelJS depends on
