Restrict triggering of email notification to when no contextual results found on the related HR case

Ram141
Tera Expert

Hi Team,

 

Can you please guide on establishing this scenario.

 

Currently we are triggering the notification to requester with related contextual search results using table configurations and we are using email script : cxs_emailsearchresults (OOB) in the email body.

 

Now I need to restrict triggering of email notification to requester when no contextual results found on the related HR case.

 

Thanks,

Ram

 

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@Ram141 

may be try using advanced notification condition and see if any search results were there or not

If not then set answer = false; in script section

answer = true;
var searchRequest = cxs_App.getActions("cxs_TableActions", current).getEmailSearchRequest(email_action);
if (!searchRequest || searchRequest == null || !searchRequest.query.freetext || !searchRequest.meta.get("runAsUser"))
    answer = false;

AnkurBawiskar_0-1770037592833.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

Thanks for the reply, I have tried this it's showing an error as "cxs_App undefined, may be missing a global qualifier" I tried by giving sn_hr_core.cxs_App but it's still the same error.