Pagination
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2016 11:23 PM
Hi Team ,
I am trying to incorporate pagination for my huge Data.I went through existing solutions but i found a new Pagination solution which i am trying to use.
Link : SN Pro Tips — GlideRecord Pagination - Page through your GlideRecord query
The Script include i am unable to use in my UI page.The output is always null.Can
Written in Processing script. Kindly let me know the error in below code.How to render data from server on UI page.
if(table=="sc_task") {
gs.include('PagedGlideRecord');
var pgr = new PagedGlideRecord(table, 'state=1', 100);
while (pgr.nextPage()) { //Loops until there are no records/pages left.
//Do some stuff, such as indicate the page number in the UI.
gs.log("test 2 :"+pgr.getPage(),"page");
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2018 02:52 PM
2 yrs ago so you probably got this fixed or moved on but here's a solution we came up with -
I hope that's what you're looking for.
Good luck,
Seth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2022 08:39 PM
you can review this latest solution built to fetch data using pagination
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2022 11:29 PM
@manasaks Hope you have created the script include.
gs.include('PagedGlideRecord'); line is not needed i think. please comment it and check.
nextPage() function expects callback function.
Please check the functionality of script include in scripts background first.
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023