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
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
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);


lisak_
Kilo Contributor

Thank you.



There is so much detail to provide when asking a question like this. I didn't tell you I was using the Catalog Task table. You mentioned the Requested Item table in your last message. I change the table in the notifications and tested. One notification went out. I'm so excited! I need to do more testing, but this may be the fix I was looking for.



Again, thank you.



Lisa


Mwatkins
ServiceNow Employee
ServiceNow Employee

Ah ha! I was wondering if that might be it.