Limits of GlideQuery

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2022 08:25 AM
I have been ignorant of GlideQuery and as I'm now learning about it, I wonder the limitations I see are accurate or just further evidence of my lack of knowledge.
1. Select *, is there a way to select all fields or do I HAVE to specify them all individually. I can surely work around this, but it seems like a very common want for a query.
2. Pagination, I see that there is a limit method but there is no skip nor is there a choose window like on the GlideRecord. This need is very important and I can hardly tell how this would not be supported.
My team works primarily in the ServicePortal realm. The ability to narrow field selection and directly map to a serializable object would be a huge benefit for our common pattern today causes us to call glide record, loop through all the records, map to a serializable object, and then loop through that object again when binding to the view. But without pagination, we will be stuck relying on GlideRecords and gaining very little from the knowledge of GlideQuery.
Thanks in advance, I'm sure I'm missing something basic here.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 12:32 PM
- You always get all field values from the GlideRecord query.
- For pagination
- I'd suggest using the out-of-the-box REST Table API that supports pagination.
Check this article Exporting Bulk Data from Servicenow via REST Web Service Pagination - GideRecord also supports pagination through the chooseWindow() method.
Check this article: GlideRecord Glimmerings: Windows...
- I'd suggest using the out-of-the-box REST Table API that supports pagination.
Hit the 👍 Helpful link ↓ if this answer brings you closer to achieving your goal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 04:27 PM
Hi,
I haven't tested but there is a utility to do pagination on GlideRecord.
https://snprotips.com/paginated-glide-record/
https://snprotips.com/blog/2016/9/1/gliderecord-pagination-page-through-records-with-ease