Notification conditions not working

oharel
Kilo Sage

Hi,

This is the situations:

My employee onboarding application generates requested items per selections of the manager in the application form. I do not want the manager to receive back anywhere between 1 to 15 emails, one for each RITM, saying that the request for the item has been received and is being handled. If possible, I would like the manager to receive one mail only summarizing the entire order, or not at all.

In the RITM form I have a reference field, which is filled only when the source of the RITM is the employee onboarding application. If it's a regular order not related to the onboarding process, that field is empty.

My problem is that when trying to configure the notification condition to send only when the reference field is empty does not work.

I tried, for instance:

if(current.u_new_employee_req == '') {

  answer=true;

}

but other fields do not work as well.

This field (u_new_employee_req) is a reference field in the request, which is filled by the onboarding application and is cascaded to the RITM via a business rule, upon the creation of the RITM.

I am wondering maybe the request is generated before all the fields are populated?

Is there any way to tell the notification not to be sent if the source of creation is the onboarding app?

Thanks

Harel

1 ACCEPTED SOLUTION

You can do this using Normal conditions instead of using advanced condition. In your script you need to use && instead of ^


View solution in original post

9 REPLIES 9

since you are creating requested items for the request... i am assuming they are invoking an item from your catalog... so you should be able to set the item field to not be that item



similar to this...



find_real_file.png


Thanks Doug,



Almost there!


Indeed, one of the items is specific to the onboarding request, but the rest are not. What *is* specific is a variable field within the RITM, called employee. If the value in it is 'Yes' then it is an employee onboarding request. So I added the following advance condition, which does not work:


if((current.variables.employee == 'No')^(current.cat_item.sys_id != '670806ce09963d402fc62090a83df074')) {


  answer=true;


}



the first part does not work. The second part, with the specific sys_id, does.


Any suggestions? are the variables even checked at this stage?


what table is your notification running on... i don't have much experience with advanced conditions sadly. but if current.variables isn't working it maybe the table the notification is on.


You can do this using Normal conditions instead of using advanced condition. In your script you need to use && instead of ^


Hi Saritha,



Using && actually did the trick, but then I realized I don't need the second part, because that specific RITM had the variable employee in it already, so in the end, it looks like this:


if(current.variables.employee == 'No') {


  answer=true;


}


Thank you and thanks Doug, who set me on the right path!


Harel