- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2020 11:51 AM
Hi All,
I am trying to combine two Encoded queries with an Or condition, example:
query 1 = 'element_id=' + converseRecord + '^valueLIKEhow^valueLIKEhelp';
query 2 ='element_id=' + converseRecord + '^valueLIKEwhat^valueLIKEissue';
gr1.addEncodedQuery(query1) || addEncodedQuery(query2);
Can anyone help how the above logic can be achieved in GlideRecord. Thank you
Thanks & Regards,
Rajalakshmi.
Solved! Go to Solution.
- Labels:
-
Guided Tours
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2020 11:59 AM
Hi,
use ^NQ operator between queries. This will evaluate one query and the other and will be like query 1 + OR + query 2. The syntax's like follows:
gr1.addEncodedQuery('element_id=' + converseRecord + '^valueLIKEhow^valueLIKEhelp^NQ' + 'element_id=' + converseRecord + '^valueLIKEwhat^valueLIKEissue');
If it was helpful, give positive feedback.
Thanks,
☆ Community Rising Star 22, 23 & 24 ☆
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2020 11:59 AM
Hi,
use ^NQ operator between queries. This will evaluate one query and the other and will be like query 1 + OR + query 2. The syntax's like follows:
gr1.addEncodedQuery('element_id=' + converseRecord + '^valueLIKEhow^valueLIKEhelp^NQ' + 'element_id=' + converseRecord + '^valueLIKEwhat^valueLIKEissue');
If it was helpful, give positive feedback.
Thanks,
☆ Community Rising Star 22, 23 & 24 ☆
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2020 12:01 PM
Please take a look at below:
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2020 02:05 PM
Hi Raji,
If you could run a filter on this table then you can add the encoded query as below:-
1) Add the filter as per your requirement:-
2) copy the query after you run this filter
3) You can add this encoded query in your script like this:-
var gr = new GlideRecord('tablename');
gr.addEncodedQuery('active=true^stateIN2,3^priority=3');
gr.query();
if(gr.next()){
}
Thanks
Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2020 02:20 PM
Hi Raji,
Same thread has been solved before follow the link
Please mark helpful/correct based on impact.
Kind Regards,
Hemant