Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Add variable condition to approval email notification

manueleriklego
Tera Expert

Hi All,

 

I have a requirement wherein to fire approval notification if a certain requested item variable is selected. Can anyone advise if they already had a experience on this and help please? Much appreciated.

 

I have a variable for country list and if value is India then fire the approval notification. Variable is under a variable set.

Catalog Name: Promotion / Salary Adjustment / Business Unit Transfer PAF 

manueleriklego_5-1709017741797.png

 

 

Variable name: 

manueleriklego_0-1709017543344.png

 

Event:

manueleriklego_3-1709017618988.png

 

 

 

Notification:

manueleriklego_1-1709017583093.png

 



 

Here's the script I created so far and notification is using a event but it is not firing as expected.

if(current.sysapproval.cat_item =='Promotion / Salary Adjustment / Business Unit Transfer PAF' && current.sysapproval.variables.entity_country == 'india'){
answer=true;
}
else{
answer=false;

}

3 REPLIES 3

_Gaurav
Kilo Sage

Hi @manueleriklego 
The notification table should be sc_req_item and in the condition builder you can select the condition like

variables > your catalog item name > select variable > is > India

 

Please mark this as helpful and accept it as a solution if this resolves your query.

Thanks!

Thank you Gaurav but I am trying to send an approval notification. Please correct me if there's something I'm missing.

@manueleriklego 
Oh my bad, so there is no need to add a condition over here.

Where you are triggering the event? Use the gs.eventQueue('event_name',current);