Scheduled report uses a condition but constantly runs?

Jared Wason
Tera Guru

Hello,

I have setup a report that I want to run the 2nd Tuesday of each month. I have setup the condition below to make it run only on the 2nd Tuesday. However for some reason this keeps triggering every day despite when I check in a background script it shows the results as returning false. Does anyone see what I am doing wrong here?

 

JaredWason_0-1666117912607.png

JaredWason_1-1666118076831.png

 

 

10 REPLIES 10

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

Can you change the Run to periodic, also why to have to if condition instead you can use just one as below:-

 

if(dayofmonth>8 && dayofmonth<14 && day==2)

{

return true;

}

else

{

return false;

}

 

Please mark my answer as correct based on Impact.

I tried both of those changes and it still triggering even though it shouldn't be.

JaredWason_0-1666122307166.png

 

Hello,

 

Can you apply logs and see what are the values are coming in for each variable. Also apply logs in if and else to check how it is behaving. We will also get to know if the function itself is getting executed or not. and change the return true/return false to below:-

 

answer = true;

 

answer = false;

  

One done let me know the result.

 

Please mark answer correct/helpful based on Impact.

Muhammad Khan
Mega Sage
Mega Sage

Refer to below link.

Scheduled Reports - Condition Script 

 

If you switch among releases (Tokyo, San Diego, Rome) of this training, you might see different condition scripts. Try utilizing those.

 

One useful note.

MuhammadKhan_0-1666122770112.png