logo

NJP

Attaching Reports to Email Notifications in ServiceNow: Including the Undocumented Part

Import · Oct 30, 2023 · article

Hi ServiceNow community!

Today, I'm going to show you how to attach reports to email notifications in ServiceNow. This is a great way to provide users with additional information when they receive an email notification.

To Attach reports use the following syntax in the Message field of the notification form:

${report:reportID:<sys_id>}

Where:

  • reportID is the type of report you want to attach (reportID, gaugeID, dashboardID, or chartID).
  • sys_id is the sys ID of the report, gauge, dashboard, or chart to be attached.

For example, to attach a report with the sys ID of abc1234567890ad12345679adhdgdgd, you would use the following syntax:

${report:reportID:abc1234567890ad12345679adhdgdgd} 

You can attach multiple reports too, for example, to attach two report with the sys IDs of abc1234567890ad12345679adhdgdgd and cde1234567890ad12345679adhdg789, you would use the following syntax:

${report:reportID:abc1234567890ad12345679adhdgdgd} 
${report:reportID:cde1234567890ad12345679adhdg789} 

By default, the report format will be PDF. However, you can change the output format to Excel using the output_type parameter. To do this, add the following syntax to the Message field of the notification form:

${report:reportID:<sys_id>:output_type:<format>}

Where:

  • reportID is the type of report you want to attach (reportID, gaugeID, dashboardID, or chartID).
  • sys_id is the sys ID of the report, gauge, dashboard, or chart to be attached.
  • output_type is the output format of the report (PDF or XLS).

For example, to attach a report with the sys ID of abc1234567890ad12345679adhdgdgd in Excel format, you would use the following syntax:

${report:reportID:abc1234567890ad12345679adhdgdgd:output_type:.xls} 

Tip: Consider the size of the report when attaching it to an email notification. Large reports may exceed the maximum file size limit for email attachments.

I hope this article has been helpful! If you have any questions, please feel free to leave a comment below.

Labels:

View original source

https://www.servicenow.com/community/developer-articles/attaching-reports-to-email-notifications-in-servicenow-including/ta-p/2716997