Reporting - Embedded Reports into Email Notification

tomsmith01
Kilo Contributor

I have a requirement to build an email notification report which will be sent out on a monthly basis by a scheduled job. In the notification amongst the HTML, the customer wants to embed reports rather than have them as attachments. Is this possible?

16 REPLIES 16

Hi Mike,



Do you have any examples of these html / css templates that I could model?   or are you able to point me in the direction of where I can get started?



The idea of being able to add a table in the email notification does sound good.



Cheers,


Brendan


Generally, I find a report that looks the way I want it out there in the wild, wild internet and look at it's source.   Then I take some of the pieces and make it my own.   I am no UX designer, so I generally don't care about what the data looks like.   I am more concerned that the data is actionable and accurate.   This is why, every time I have to build a page, I have to relearn CSS and HTML.   That being said, I generally find a site like Top 24 Simple, Yet Beautiful CSS3 Table Templates And Examples - Colorlib   and go from there.



The notification email script has a call template.print and it accepts strings with html in it, similar to this:



template.print("<div style='width: 100%; height: 700px'><iframe id='report_target' name='report_target' src='https://dev27082.service-now.com/sys_report_display.do?sysparm_report_id=82240486dfb0010068c37a0d3df...' width='100%' height='700px' scrolling='yes'></iframe></div>");


I would throw all CSS in one notification script and the html code in another.   Another key piece to remember is that the script area of the record takes ~4000 characters, which html can fill up pretty quickly.   Using one notification script per report would probably be the best method.   Then, in the notification, just list the scripts one after another, starting with the CSS and ending with some footer.



find_real_file.png


Also, when styling, use ServiceNow Design System as a helpful way to ensure your work looks like the ServiceNow style.


Hi Mike,



Thanks a lot for all this information.



Just a question, when you put the css into a notification script, does it need any javascript, or can I just start adding the css styling?



Cheers,


Brendan