Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Schedule email every 3 months

markusst
Kilo Expert

how is it possible to send a report every 3 months? Only with 90 days? I want to send a report every last day each 3 months... 

6 ACCEPTED SOLUTIONS

Jordan Vignoni
Tera Guru

If the report needs to be sent every 90 days, you can configure the scheduled report to:
Run:  Periodically
Repeat Interval: 90 days

Starting:  Your desired start date.

 

However, if it needs to be the last day every 3 months, you would have to script this by checking "Conditional" and writing the script in "Condition".

View solution in original post

markusst
Kilo Expert

I've no scripting knowledge... does a Guide exists?

 

View solution in original post

markusst
Kilo Expert

Is there any Guide for scripting? I've no experience in scripting...

View solution in original post

Nicholas_Gann
Mega Guru

This seems like it would be possible as there is a condition field on Scheduled Reports. You could set the report to run monthly on the 31st day of the month (which i assume would translate to being the last day of any month which contains less than 31 days). In the condition field you could then do something similar to:

 

var validMonths = [3,6,9,12]; // Months where the report will run
var gd = new GlideDate();
validMonths.indexOf(gd.getMonthNoTZ()) > -1;

 

View solution in original post

Sumanth16
Kilo Patron

Hi @markusst ,

 

In the scheduled report module, there is an option called Conditional, please select that check box and you can write a code to control when the report should run.

 

In your the below code will do the trick -



function checkFirstDayofThirdMonth(){

 

var triggerMonths = [1, 4, 7, 10]; //Jan, Apr, Jul, Oct




var currDt = new Date();

 

var currMonth = currDt.getMonth()+1;

 

var currDate = currDt.getDayOfMonth();




  for (i in triggerMonths){

 

  if (currMonth == triggerMonths[i] && currDate == 1)

 

  return true;

 

  }

 

  return false;

 

}



checkFirstDayofThirdMonth();

 

 

Plz mark my solution as Accept, If you find it helpful.

 

 

Thanks & Regards,

Sumanth meda

View solution in original post

I would check out Now Learning - https://nowlearning.servicenow.com.  There are a handful of scripting courses available.

View solution in original post

6 REPLIES 6

Nicholas_Gann
Mega Guru

This seems like it would be possible as there is a condition field on Scheduled Reports. You could set the report to run monthly on the 31st day of the month (which i assume would translate to being the last day of any month which contains less than 31 days). In the condition field you could then do something similar to:

 

var validMonths = [3,6,9,12]; // Months where the report will run
var gd = new GlideDate();
validMonths.indexOf(gd.getMonthNoTZ()) > -1;

 

Sumanth16
Kilo Patron

Hi @markusst ,

 

In the scheduled report module, there is an option called Conditional, please select that check box and you can write a code to control when the report should run.

 

In your the below code will do the trick -



function checkFirstDayofThirdMonth(){

 

var triggerMonths = [1, 4, 7, 10]; //Jan, Apr, Jul, Oct




var currDt = new Date();

 

var currMonth = currDt.getMonth()+1;

 

var currDate = currDt.getDayOfMonth();




  for (i in triggerMonths){

 

  if (currMonth == triggerMonths[i] && currDate == 1)

 

  return true;

 

  }

 

  return false;

 

}



checkFirstDayofThirdMonth();

 

 

Plz mark my solution as Accept, If you find it helpful.

 

 

Thanks & Regards,

Sumanth meda