How to set the number of records in the Report in the dashboard

SanikaK
Tera Contributor

I have requirement where I have created the Dashboard. In that dashboard I have added the report through widget. The Report shows the list of total numberof records in the table. I need to show only the 1st 10 records in that report. How should I configure this. 

Attaching the current dashboard for reference.

13 REPLIES 13

Deepak Shaerma
Kilo Sage

hi @SanikaK 

In ServiceNow reports, there's no direct out-of-the-box setting within the report builder UI to limit the report display to only the first 10 records.

If this information proves useful, kindly mark it as helpful or accepted solution.

Best regards,
Deepak Sharma

Service_RNow
Mega Sage

@SanikaK 

In ServiceNow, reports are often built on tables or saved filters.

To limit records:

  • Open the report in Report Designer.

  • In the "Style" tab or "Format" tab (depending on your version), look for "Maximum number of records".

  • Set this to 10.

  • Save the report.

  • Refresh your Dashboard widget – it will now show only the top 10 records.

Chaitanya ILCR
Kilo Patron

Hi @SanikaK ,

 

I don't think we can limit them directly 

follow this instead

create a script include with sandbox enabled true

var RecordFetcher = Class.create();
RecordFetcher.prototype = {
    initialize: function() {},

    getTop10SysIds: function() {
        var result = [];

        var gr = new GlideRecord('sn_cim_register'); //update your table name looking at screenshot looks like those are continual improvement records

        gr.addEncodedQuery('addYOurEncodeQuery here'); //add encoded query here
        gr.setLimit(10);
        // gr.orderByDesc('sys_created_on') use orderBy if need  I'm commenting this
        gr.query();

        while (gr.next()) {
            result.push(gr.getValue('sys_id'));
        }

        return result.join();
    },

    type: 'RecordFetcher'
};

 

ChaitanyaILCR_0-1747374205050.png

 

open the report and add the filter sysid is on of 

javascript:new RecordFetcher().getTop10SysIds()

ChaitanyaILCR_1-1747374403805.png

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

AndersBGS
Tera Patron
Tera Patron

Hi @SanikaK ,

 

Is it to show only 10 records or show 10 records pr. page? e.g. if 100 records then 10 pages.

 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/