How to schedule a semi-monthly report with date-based records and email attachment?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
41m ago
Hi Community,
I have a requirement in ServiceNow where I need to send a report by email on the 1st and 15th of every month.
The requirement is:
On the 1st of the month, I need to send all records that were created from the 15th of the previous month through the 1st of the current month.
On the 15th of the month, I need to send all records that were created from the 2nd through the 14th of the current month.
The report should contain the required records in an Excel attachment.
I already have a Notification/Email Template that needs to be used for sending the email.
The Excel file should be attached to the email and sent to specific recipients.
For example:
October 1st:
Records created from September 15th → October 1st
October 15th:
Records created from October 2nd → October 14th
I am considering using a Scheduled Script Execution to run the process and dynamically calculate the date range, retrieve the records, generate the Excel attachment, and trigger the notification.
Could someone please suggest the recommended ServiceNow approach for implementing this requirement?
Specifically, I would like to understand:
How should I configure the Scheduled Job to run on the 1st and 15th?
How can I dynamically calculate the required date range?
What is the recommended way to generate the Excel report?
How can I attach the generated Excel file to the email?
How can I trigger the existing Notification/Email Template after the attachment is created?
Is there a better/recommended approach than Scheduled Script Execution for this requirement?
Any guidance or example implementation would be greatly appreciated.
Thank you.
