Print all content of each dashboard widget to an email export

pbusch
Tera Expert

Hi team,

 

1. Dashboard XYZ on my instance featured widgets which are either list reports or static HTML content blocks. 1a. A stakeholder would like to be able to export the current contents of the widgets to an email.
1b. It is desired to accomplish this via clicking a dedicated widget on the dashboard, or via a favorite module on the left-hand Application Nevigator.
 
Our instance Build tag is  glide-washingtondc-12-20-2023__patch2-hotfix1-04-15-2024.
 
Using business rule and mail script I've been able to get nicely formatted contents of individual scheduled reports to map nicely to the body of emails and send out to stakeholders, but the above requirement is of a significantly different nature;
Does any one have any insights on how to go about accomplishing this? 
 
Thanks,
Pat
~ "Breynia Disticha"
2 REPLIES 2

Kris Moncada
Tera Guru

Hi @pbusch ,

 

On a previous contract, I built a widget that displayed a custom report; of which that widget was then added to a dashboard, 

 

The part you might interested in was that each report widget contained a button that started a download of PDF. The PDF was generated by querying the DOM and then sending the resulting "outerHTML" to ServiceNow's PDF generator utility. The resulting PDF looked great because we were also passing in the necessary styles; of which the custom report looked near 1 to 1 with the Dashboard version.

 

So... I think you could do something similar where you create a dedicated widget that contained a button called Export Dashboard to Email.  Clicking the button would then query the DOM to get the necessary HTML... then send that to mail script.

 

Hopefully this provided some new ideas. 

Hi Kris,

 

That is a nice take to this, and may be the only way to accomplish the Requirement here. I'll take it under consideration.

Do share if you have any of the jellyscript code to accomplish that.

 

Thanks,

Pat

~ "Breynia Disticha"