How to show list record count in the notification body

Poorva Bhawsar
Mega Sage

Hi Community,

 

How to show the list view records count in the notification body. Suppose we have 15 incidents whose status is work in progress. We want to show 15 as a count in the notification body.

 

Thanks

1 ACCEPTED SOLUTION

Pooja2998
Mega Sage
Email script:
var
gr = new GlideRecord('incident');
    gr.addQuery('state', '2');
    gr.query();
    template.print("Total incident count which are in WIP: " + gr.getRowCount() + "<br/>");
    while (gr.next()) {
        template.print('Incident Number: ' + gr.getValue('number') +  "<br/>");
    }

In notification you can call that Email script: ${mail_script:emailscriptname}

View solution in original post

3 REPLIES 3

Najmuddin Mohd
Mega Sage

Hi @Poorva Bhawsar ,

You can create an Email script and call it in the notification.
You can also have a look into Scheduled reports, if you want to analyse the information.

If the above information helps you, Kindly mark it as Helpful and Accept the solution.
Regards,
Najmuddin.

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @Poorva Bhawsar ,

 

1. You got to create a mail script which will query the same condition which is in your report and use getRowCount() to the count of records.

 

2. Create a notification were you can call this mailscript and how the numer in email.

 

I hope it helps...


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Pooja2998
Mega Sage
Email script:
var
gr = new GlideRecord('incident');
    gr.addQuery('state', '2');
    gr.query();
    template.print("Total incident count which are in WIP: " + gr.getRowCount() + "<br/>");
    while (gr.next()) {
        template.print('Incident Number: ' + gr.getValue('number') +  "<br/>");
    }

In notification you can call that Email script: ${mail_script:emailscriptname}