Do not send scheduled report if parent report has no records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2022 02:26 AM
Hi Folks,
I have created a scheduled report and it includes two other reports, If the parent report doesnt have any records then even if other reports have record the email should not go out....currently even if I select 'omit if no records' on parent report and if other reports have record the email is going out with those reports getting attached .... Any OOB way to achieve it ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2022 02:31 AM
hello @Tapish Sharma1 ,
try doing conditional scripting by checking conditional check box and in that script you can glide record to parent table where the parent report is configured on and build the exact same query which you gave in report and fetch the count and if the count is 0 return false
var gr = new GlideRecord('your_parent_table');
gr.addQuery('field_name','value');
gr.query();
var count = gr.getRowCount();
if (count==0)
{
return false;
}
else
{
return true;
}
Hope this helps
Mark the answer correct if this helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2022 03:26 AM
Hi , thanks for your reply
For some reason the conditional scripting works if the report is not included with any other report.....If it is included the email still goes out