- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2022 11:19 PM
Hello Community,
Is it possible that you cannot add an "addOrCondition" to an EncodedQuery?
So I am talking about something like this:
var qc = current.addEncodedQuery("u_xydate@dayofweek@ago@90");
qc.addOrCondition('active', true);
Of course I can include the OR directly in the encoded query.... is that maybe the reason why it doesn't work?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2022 11:27 PM
Hi,
In EncodedQuery should add/concat the query instead of addQrCondition.
It is supported for addQuery only.
You can refer this article nicely written by
How To Write GlideRecord Queries Like A Pro
Thanks!
Sagar Pagar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2022 11:22 PM
Hey,
Please include addorcondition directly in addEncoded query:
var qc = current.addEncodedQuery("u_xydate@dayofweek@ago@90^ORactive=true");
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2022 11:27 PM
Hi,
In EncodedQuery should add/concat the query instead of addQrCondition.
It is supported for addQuery only.
You can refer this article nicely written by
How To Write GlideRecord Queries Like A Pro
Thanks!
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2022 11:44 PM
Hi,
yes the function doesn't seem to show when you use encodedQuery
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader