Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to use Pagination using script

String
Kilo Sage

Hi Team ,

Am using below script to get the pagination 

 

var limit = 3;
var offset = 1;

var gr = new GlideRecord('incident');

gr.addQuery('short_description','test');
gr.orderByDesc("number");
gr.setLimit(limit);
gr.setOffset(offset);
gr.query();

while (gr.next()) {
var fieldValue = gr.getValue('number');
gs.info(fieldValue);
}

 

Note:setLimit is working but setOffset syntax is not working

am getting the same values (number) after changing Offset 

 

Please guide me 

0 REPLIES 0