Conditional Scheduled report

Tapish Sharma1
Kilo Sage

Hi Folks,

i am trying to create a conditional scheduled report. But in the condition script box i am not able to create a function nor I am able to call a script include . i need to check if a table has records and only then trigger the report. In the documentation it is mentions contional script is sandbox script and runs in sandbox environment

" Conditional scripts for scheduled report emails are executed in the sandbox. Therefore, function definitions are not allowed. Some API calls and keywords are also not allowed. For more information, see Script sandbox property."

. Not sure How can I run the script ? I tried below script but it is not working ....neither is calling script include or functions working ...

TapishSharma1_0-1668438442085.png

var rec = new GlideRecord('sn_customerservice_contact_relationship');
rec.addEncodedQuery('company=a525514f1b5d11101786dbd3b24bcb36^u_contact_last_updatedONYesterday@javascript:gs.beginningOfYesterday()@javascript:gs.endOfYesterday()^ORu_contact_last_validatedONYesterday@javascript:gs.beginningOfYesterday()@javascript:gs.endOfYesterday()^responsibilityLIKE4d50a30e1b4f9510c4ac21f0b24bcb75');
rec.query();
var count = rec.getRowCount();
// gs.info('Count ' +count);

if (count==0)
{
answer = false;
}
else
{
answer = true;
}

0 REPLIES 0