how to create scheduled reports for quarterly & yearly ?

allu srihari
Tera Contributor

hi can anyone help me to create scheduled script for quarterly and yearly on last day of the month

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Example (= tested):

find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

9 REPLIES 9

allu srihari
Tera Contributor

could you send me the script for quarterly scheduled report

 

Mark Roethof
Tera Patron
Tera Patron

Example (= tested):

find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

allu srihari
Tera Contributor

could you send the schedule report script for yearly?

 

You can try

 

var getdtime = new GlideDateTime();
var getmonth = getdtime.getMonth();
if (getmonth == '12'){ //yearly
var getdate = getdtime.getDate();
if(getdate == '31') //last day of DEc
{
answer=true;
}
}

 

Same only strip the:

 || month == 4 || month == 7 || month == 10

So something like:

var month = new GlideDate().getMonth();

if(month == 1) {
	answer = true;
}

For the last day of the month...

You don't have to script this, this is a selectable field: Day. Set this to 31st like I mentioned earlier.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP

---

LinkedIn
Community article list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn