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.

How to specify multiple conditions in "Advanced condition" of Notification

Yuki21
Tera Expert

Hello.
How can I specify multiple conditions in "Advanced condition" of Notification?

I didn't get the correct result with the script below.

 

 

if(current.variables.req_category_1 == true || current.variables.req_category_3 == true){
  answer = true;
} else {
  answer = false;
}

 

 

キャプチャ.PNG

1 ACCEPTED SOLUTION

Pavankumar_1
Mega Patron

Hi @Yuki21 ,

Try below script and replace with your script.

if (current.variables.req_category_1 == 'true' || current.variables.req_category_3 == 'true') {
    answer = true;
} else {
    answer = false;
}

 

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

View solution in original post

3 REPLIES 3

Pavankumar_1
Mega Patron

Hi @Yuki21 ,

Try below script and replace with your script.

if (current.variables.req_category_1 == 'true' || current.variables.req_category_3 == 'true') {
    answer = true;
} else {
    answer = false;
}

 

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

Thank you!
It was a simple mistake...

GodOfWar
Mega Guru

Variables can't be used like ordinary fields in the advanced condition. It's either you use a Business rule with an event as a trigger to call a notification or use the simple conditions of the notification.

 

Don't hesitate to click the Helpful button if this helps.