ismr

GlideQuery Parse()

New GQ method introduced with the San Diego release.

After years of GlideRecord, the introduction of GlideQuery was a happy surprise to me, and GlideQuery has since been a API that I use whenever the opportunity allows.

So far a particular disadvantage or shortcoming compared to GlideRecord has been that it did not support encoded queries. Because of this I was especially happy when I saw the Parse method mentioned in the San Diego release notes.

Example

var  = 'active=true^priority=1^ORDERBYopened_at'
GlideQuery.parse('incident', query) 
  .select('number')
  .forEach(function(x){
  gs.info(x.number);
  });

Note that this method does not support all GlideRecord encoded query operators.

The Product Documentation describes the currently supported operators: GlideQuery - Scoped, Global (servicenow.com)

GlideQuery

comment on twitter

All rights reserved.