- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2022 11:57 AM
Hi,
We have a record producer form with the variable "xyz" type is select box with the choices "yes" and "no" . If we select "yes" the text "call is required" should add in the beginning of the subject line with in the existing notification.
Thanks in Advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2022 01:01 PM
Create a mail script by navigating to System Notification >> Email >> Notification mail script named: check_variable_add_subject
with below script
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var subj = email.getSubject();//get current subject from notification
var checkvariable = current.variables.variable_name; //replace variable_name with yes no variable name
if (checkvariable == 'true' || checkvariable == true) {
email.setSubject('Call is required - ' + subj);
}
})(current, template, email, email_action, event);
Use ${mail_script:check_variable_add_subject} in the notification's Message field in What it will contains tab.
Above will work considering notification is on RITM or Incident table or any other table that has variables accessible directly.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2022 01:01 PM
Create a mail script by navigating to System Notification >> Email >> Notification mail script named: check_variable_add_subject
with below script
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var subj = email.getSubject();//get current subject from notification
var checkvariable = current.variables.variable_name; //replace variable_name with yes no variable name
if (checkvariable == 'true' || checkvariable == true) {
email.setSubject('Call is required - ' + subj);
}
})(current, template, email, email_action, event);
Use ${mail_script:check_variable_add_subject} in the notification's Message field in What it will contains tab.
Above will work considering notification is on RITM or Incident table or any other table that has variables accessible directly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-09-2022 06:25 AM