Add a timestamp to a scheduled report

Not applicable

We have a few scheduled reports that are delivered to our service delivery manager daily, currently the subject / file name is the same everytime.

 

Is there a way to timestamp either the subject line or attachment file name?

1 ACCEPTED SOLUTION

CapaJC
ServiceNow Employee
ServiceNow Employee

When configuring a Scheduled Report, the Subject line now accepts JavaScript. e.g., the following in the Subject of a scheduled report will put the current date in the resultant email (e.g., for a report of today's problems):

javascript:"Problems created on " + gs.now();


View solution in original post

21 REPLIES 21

What does an email have to do with the TITLE of the report? Please only provide information that answers the question.

Ron Hoyt.

slevin
Kilo Explorer

Thanks, CapaJC

That worked.

I have also looked for tomorrow - eg,



javascript:"Changes scheduled " + gs.now() + " - " + gs.tomorrow();


Any ideas?
Thanks!


CapaJC
ServiceNow Employee
ServiceNow Employee

Not sure how to get just the date part of tomorrow, but the following will give you 1) a date/time string for the start of tomorrow, and 2) the date/time 24 hours from now:



gs.daysAgoStart(-1);
gs.daysAgo(-1);


The name of the attachment is not similarly customizable, to my knowledge.


wei2
Tera Contributor

Thanks!