The CreatorCon Call for Content is officially open! Get started here.

Using Keyword search in encoded query - one last try

Sandy7
Tera Expert

Hello - i posted another question and have received some good responses but am still having issues solving this problem -

I have an encoded query in a mail script -- and I need this to return records from the incident table that have the keywords "grants approval" ... so the incident has to have both words as a phrase - "grants approval".. I can get this to work to the point where it's returning records that have "grants approval" - but it's also pulling in records that just have the word "grants".  When I go to the list view of the incidents and put this in the query there - it works. But when I move this into an encoded query - it doesn't. Here is what I have ..I have tried different variations of it.  Can someone help? Is this possible? It seems like it should be if  it's possible from the actual reporting module. Thanks in advance. 

 

var gr = new GlideRecord("incident");
gr.addEncodedQuery('GOTO123TEXTQUERY321=grants approval');

gr.addEncodedQuery('priorityIN3,4,5^sys_created_onRELATIVEGE@hour@ago@24^assignment_group!=cf0639b6f5d84140b6baf27ba2d29cd4^ORassignment_group!=de9ae95874ce650094333bd4eb6f34db');

5 REPLIES 5

Milind Gharte
Kilo Guru

Swapnil Soni1
Giga Guru

Hi,

Please check this link

https://codecreative.io/blog/how-to-do-full-text-search-with-gliderecord/

 

If this works!! Please mark correct or helpful.

Thanks

Swapnil

Thanks - I've tried every combination in here and I cannot get this to work. I am facing a somewhat urgent deadline and have been trying to get this working for a while now. Do you know if, given the script below, if it is even possible to return records that contain just the phrase "grants approval" -

gr.addEncodedQuery('GOTO123TEXTQUERY321="grants approval"^priorityIN3,4,5^sys_created_onRELATIVEGE@hour@ago@24^assignment_group!=cf0639b6f5d84140b6baf27ba2d29cd4^ORassignment_group!=de9ae95874ce650094333bd4eb6f34db');

I have also tried 

ar gr = new GlideRecord("incident");
gr.addEncodedQuery('GOTO123TEXTQUERY321=grants approval');

gr.addEncodedQuery('priorityIN3,4,5^sys_created_onRELATIVEGE@hour@ago@24^assignment_group!=cf0639b6f5d84140b6baf27ba2d29cd4^ORassignment_group!=de9ae95874ce650094333bd4eb6f34db');

I have also tried from the article you supplied  "contains" , I have tried In_And_query.. nothing is working. Just looking for some specific help if you have any. I really appreciate it