We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Adding previous months in subject line of scheduled reports

Akhilkumar2
Mega Contributor

Hi,

I have to schedule a report in servicenow.

I want a subject line as " Report of MM-YYYY" format

the month should be  previous months.

Any one knows the java script ,, kindly post the answer.

 

1 ACCEPTED SOLUTION

Hi Akhil,

Exactly I thought of it and tried to put that content into subject line. BUT unfortunately the subject field has a Limit of 80 characters. 😄 :D.  Can't help it there.

 

find_real_file.png

 

Thanks,
Saikiran Guduri (NOW)
(Please mark the answer as correct answer/helpful/accept the solution if it helps)

 

View solution in original post

11 REPLIES 11

Akhilkumar2
Mega Contributor

okk..

if I want to add some text like

 

"Report for"+ script

will this work

 

I have added the text in the script itself "Report for"+<FORMATTED_DATE>.

If you want more text to be added continue it in the same place(in script).

Once this part is done you should write this into the subject line:-

javascript:test1();

 

Thanks,
Saikiran Guduri (NOW)
(Please mark the answer as correct answer/helpful/accept the solution if it helps)

 

can I put the whole script in the subject line ( that you gave in the first reply )

 

could plz send me a screenshot that you have done.. where to put script and where to call the function

Hi Akhil,

Exactly I thought of it and tried to put that content into subject line. BUT unfortunately the subject field has a Limit of 80 characters. 😄 :D.  Can't help it there.

find_real_file.png

You need to create a "Script include" for keeping that script.

Type "Script includes" in left navigator and create a script include and name it as something eg: test1.

Copy paste the script I mentioned above into that script include. Save it. Then come to subject line in this scheduled reports and out the javascript:test1();.

Thanks,
Saikiran Guduri (NOW)
(Please mark the answer as correct answer/helpful/accept the solution if it helps)