Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Notification email advanced condition

Community Alums
Not applicable

Hi All,

 

I have a requirement where if the requested for of an RITM is a vip user then the notification shouldn't be sent to that user. I have used advanced condition in the notification and my script is.

If(current.requested_for.vip== false)

    answer=true;

else

    answer=false;

 

But everytime this script returns true, can anyone please help me what am I missing here?

Thanks in advance.

 

Regards,

Saurabh

4 REPLIES 4

Jaspal Singh
Mega Patron
Mega Patron

Hi Saurabh,

Can you try below

If(current.requested_for.vip== false)
{
    answer=false; //do not trigger
}
else
{
    answer=true;//trigger
}

Community Alums
Not applicable

Hello Jaspal,

Thank you for your quick response. I tried the script but it is still not working.

Try below

var ritmis=new GlideRecord('sc_request');
ritmis.addQuery('sys_id',current.request);
ritmis.query();
if(ritmis.next())
	{
		if(ritmis.requested_for.vip =='false' || ritmis.requested_for.vip == false)
			{
				answer=true; //trigger
			}
		else
			{
				answer=false; //do not trigger
			}
	}

Community Alums
Not applicable

This one didn't work either.🥲