How to query doesn't contain in glide record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 06:57 AM - edited 10-27-2022 07:06 AM
Hi All,
How to Query does not contain in glide record. Tried below but not working.
Need to query "if a particular RITM no is not available in sc_req_item"
if (emailsubject.includes("RITM")) {
subject = emailsubject;
indexStart = subject.indexOf('RITM');
number = subject.slice(indexStart, indexStart + 12);
gs.log("custmint191" + number);
var sc_item1 = new GlideRecord("sc_req_item");
//sc_item1.addEncodedQuery('number NOT LIKE number');
//sc_item1.addEncodedQuery('number DOES NOT CONTAIN number');
//sc_item1.addEncodedQuery('numberNOT LIKE' + number);
sc_item1.query();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 07:15 AM
Hello,
Please use it as below assuming you are storing the number correctly in the number variable:-
sc_item1.addEncodedQuery('numberNOT LIKE'+number);
OR
try as below:-
gm.addQuery('number','DOES NOT CONTAIN',number);
Please mark my answer as correct based on Impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 07:25 AM
I need to add it in a or condition tried it below query but not working
sc_item1.addEncodedQuery('number, number ^stateIN3,4,7,110^ORnumber NOT LIKE number');
sc_item1.addEncodedQuery('number, number ^stateIN3,4,7,110^ORnumber DOES NOT CONTAIN number');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 08:45 AM
Hello,
Can you write in text what the query should be and then I can help with the query itself
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 11:08 PM
glide RITM table and look for records that either contains number which have extracted from the email and state should be one of 3,4,7,110 or which do not contains number
These 3 conditions need to consider while querying