Limits of GlideQuery

raprohaska
Kilo Guru

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.

2 REPLIES 2

Marc Mouries
ServiceNow Employee
ServiceNow Employee
  1. You always get all field values from the GlideRecord query.
  2. For pagination
    1. 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
    2.  GideRecord also supports pagination through the chooseWindow() method.
      Check this article: GlideRecord Glimmerings: Windows...

 

Hit the 👍 Helpful link ↓ if this answer brings you closer to achieving your goal

Hitoshi Ozawa
Giga Sage
Giga Sage