To export report as an excel automatically
						
					
					
				
			
		
	
			
	
	
	
	
	
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2025 07:13 AM
Hi All,
I have created a report in ServiceNow and would like to automate the process of exporting its Excel format daily into a custom table. Currently, when a scheduled report is triggered, an Excel copy of the report is attached to the email and stored in the sys_attachment table.
Instead of sending the report via email, our customer would prefer that the Excel file be stored directly in a custom table on a daily basis. I would like to replicate the same functionality—where the Excel file is generated and attached—but redirect the attachment to our custom table rather than to an email.
Could you please advise if there is a recommended approach to achieve this within Servic.eNow
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2025 10:59 PM
HI @Niranjani1 ,
Please follow these Steps:
- Create a Custom Table - Build a custom table to store daily report records. 
- Include fields like report name, run date, and any other needed metadata. 
 
- Create a Scheduled Script Execution - Set up a Scheduled Script Execution (scheduled job) to run daily at the desired time. 
 
- Generate Excel Data via API - In your scheduled script, use ServiceNow APIs to generate the report data in Excel format, based on the same tables and filters as your report. 
 
- Create a New Record in the Custom Table - The script creates a new record in your custom table to represent the daily report. 
 
- Attach the Excel File to the Custom Record - Use the GlideSysAttachment API to attach the generated Excel file directly to the new record. 
 
Mark this as helpful and correct if this answers your question.
Thanks,
Yaswanth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2025 11:12 PM
have some custom business rule on sys_email table to detect that file has been added to email record and it's for your report.
once identified create a record into custom table and then use GlideSysAttachment.copy() to copy the file to that record.
Please start from your side and it's an easy requirement.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2025 12:40 AM
Hi @Ankur Bawiskar ,
Thanks for your response. But my requirement is to add the excel format of the report in custom table without sending an email. So it won't get added in sys_email table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2025 06:27 AM
I will suggest let record be inserted into sys_email
Run before insert/update BR and mark that email record as ignored in the same BR and copy the file to custom table record.
With this your requirement is achieved and email is also not sent.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
