Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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

Allen Andreas
Tera Patron

Hi,

Please see this link: https://community.servicenow.com/community?id=community_question&sys_id=31b25ba1db101fc01dcaf3231f96...

Please mark any reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Saikiran Gudur1
Mega Guru

Hi Akhil Kumar,

Create a small basic script include with direct callable function :

function test1(){
var gdt = new GlideDateTime();
gdt.addMonths(-1);
return ("Report of "+gdt.getDate().getByFormat("MM-yyyy"));
}

Call this function using javascript:test1(); from the subject line

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

hi saikiran,

is this script should place in the script fie

find_real_file.pngld of scheduled report when condition box checked??

Hi Akhil. it is to include in Subject line