- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 05:11 AM - edited 02-04-2025 05:13 AM
Hi Team,
My Requirement:
If user select the " Is this in scope of MF2 initiative = Yes" , Send email notification to user , if user select the " Is this in scope of MF2 initiative = no " not required to send email notification.
Is there any requests associated with MF2=YES , This notification will be sent .
There are 20 notifications are there in the system so we can add this "Is this in scope of MF2 initiative? = Yes" line to
existing notifications if the users select to the MF2.
Please help me how can we achieve this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 01:49 AM
use this
var mf2initiative = current.variables.mf2initiative.getDisplayValue();
if (mf2initiative == 'Yes') {
template.print('Yes');
} else {
template.print('No');
}
})(current, template, email, email_action, event);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 01:37 AM
Thanks for your response.
The above script is not working it's show undefined.
My requirement is
I want to fetch the mf2 initiative from the variables.
If user select "YES" , Is this in scope of MF2 initiative? = Yes will be added to the Email notification
If user select "no" , Is this in scope of MF2 initiative? = No will be added to the Email notification
Based upon the User selection
screenshots attached for reference
I have added below line in Message HTML section
I have preview notification , it shows undefined
Instead of Undefined we need YES or NO
Please help me how can I achieve this.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 01:49 AM
use this
var mf2initiative = current.variables.mf2initiative.getDisplayValue();
if (mf2initiative == 'Yes') {
template.print('Yes');
} else {
template.print('No');
}
})(current, template, email, email_action, event);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 04:44 AM
Any update to this?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 04:54 AM
It's working Thank you for your support.