- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2015 01:46 AM
Hi all,
I would like to create a custom table with pagination. I need to fill table with GlideRecord query.
I know that it is possible to use setLimit(int) function to get only requested number of rows, but it is somehow possible to set offset of this records, to be able to use pagination for fetching second, third... set of items ?
Example:
var gr = new GlideRecord('incident');
gr.skip(30); ----> how to do something like this ?
gr.setLimit(10);
gr.query();
1, 2, 3, 4, 5
---> will return fourth set of 10 records
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2015 04:21 AM
Hi Peter,
I think this is what you are looking for
gr.chooseWindow(10, 20); // this will give you 10 records, starting form the 11th to 20th.
Real more here in depth
GlideRecord Glimmerings: Windows...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2015 04:27 AM
oh im sorry im taking my words back. I miss understood the question.
What Anurag propose that can work in your case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2015 04:21 AM
Hi Peter,
I think this is what you are looking for
gr.chooseWindow(10, 20); // this will give you 10 records, starting form the 11th to 20th.
Real more here in depth
GlideRecord Glimmerings: Windows...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2015 04:33 AM
Hi Anurag,
you hit the nail , thanks a lot, this is exactly what I was looking for.
By the way, really strange name of the function and I don't understand why it isn't a part of official GlideRecord documentation on wiki 😕
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2015 04:36 AM
i know, its not documented properly also, you wont it on wiki also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2023 06:39 PM
Holy cow is THIS some hard to find knowledge!?!?! Thank you for posting it.
Working on a Scripted REST, and I'm like, "How the heck do I return paged chunks of data?" There's literally zero in any of the REST docs or even Glide. If you search for "offset," which is the common way to talk about it, you can't find a solution, anywhere. We need to get this tagged to a few other use cases in the documentation ... for real.