Jelly UI Page - less than / greater query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2013 08:27 AM
Hi All
I'm trying to write a UI page to do a glide query with a 'greater than' or 'less than' operator but the xml doesn't like it !
How do i do .....
gr.addQuery("priority", ">", "3");
or ...gr.addQuery("priority", "<", "3");
I'll also need to run queries by date also.. something like...
gr.addQuery('u_time', '<', start);
I've had a look at using ${AMP}lt; and ${AMP}gt; but can't seem to get the syntax correct.
(http://wiki.servicenow.com/index.php?title=Extensions_to_Jelly_Syntax#Less_Than)
UI Page XML attached.
Hoping that this is a very quick syntax issue.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2013 09:07 AM
You can try with this snippet. I tested it and is working fine.
var queryString = "priority=1^ORpriority=2";
var gr = new GlideRecord("incident");
gr.addQuery("active", true);
gr.addEncodedQuery(queryString);
gr.query();
gr;
I hope this gives you some insight..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2013 09:14 AM
Found it ! answered my own question !
<<less than
>>greater than
gr.addQuery("priority","<","3");
or
gr.addQuery("priority",">","3");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 11:41 AM
Hi Nick,
I am having trouble with the less than operator in my UI Macro script
gr.addQuery("priority","<","3"); is not working. The greater than operator is working though.
Any idea how I can escape the character?
Thanks,
Jenny

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 12:35 PM
have you tried with ${GT}
gr.addQuery("priority",${GT},"3");
or
gr.addQuery("priority",'${GT}',"3");