when to send conditions for email notifications based on request form variables

lisak_
Kilo Contributor

I want to send an email notification when the Application is Percolate, the State is Closed Complete, a variable on the request form is either employee or agency and a variable on the request form is one of four options (feed, seed, DF or corp). When I test what I have set up emails go out for all of the four options even if just one is selected. I think my logic is correct regarding the when to send conditions, so I'm wondering if I can't set up the conditions based on the variable on the request form. Does anyone know if this is doable or not?

I tried adding more conditions and was not successful. (MoreEmailNotifications attachment)

1 ACCEPTED SOLUTION

Mwatkins
ServiceNow Employee

Hm... I can't explain why this would happen. If your notification is running on a RITM record (sc_req_item) you ought to have access to the Variables object through the condition builder. It works for me in my instance when I test a similar, albeit simplified filter. When the checkbox is unchecked, the Notification does not fire. When the checkbox is checked, the Notification does fire.


Screenshot 2017-06-22 09.45.51.png


What happens when you put some code in the Email Notification to output the values of the variables? Anything unexpected? (see JavaScript in emails )


//obviously, you should replace these variable names with your actual, case sensitive variable names.


gs.info("df: " + current.variables.df + ", corp: " + current.variables.corp);


View solution in original post

7 REPLIES 7

Mwatkins
ServiceNow Employee

So... are you saying that, for example, even though the variable "Corporate" is "false", the notification with the condition for "Corporate" is "true" still fires?


lisak_
Kilo Contributor

Yes



Lisa


Mwatkins
ServiceNow Employee

Also, what type of variables are Feed, Seed, DF and Corp? Is each one a separate Checkbox variable and was the variable type ever changed?


lisak_
Kilo Contributor

They are separate check boxes so each would be a separate true/false value.



Lisa