Conditional Logic on Email Notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
For email notifications, is it possible to use conditional logic for what the email will contain? For instance, if the short description contains "application related request" then add another piece of information like the long description?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
57m ago
Sure! Depending on what you're using to generate the notification, you can use a mail script:
https://www.servicenow.com/docs/r/platform-administration/c_ScriptingForEmailNotifications.html
Or if you're using the "send email" flow action, then you can specify the logic that creates the email body.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
45m ago
yes this is feasible
you can use email script and use script there to add dynamic email body, even dynamic subject etc
Scripting for email notifications
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
41m ago
Hi @sseverance
Yes. You can use Mail Scripts or Notification Email Scripts to add conditional logic to the email content.
if (current.short_description.indexOf("application related request") > -1) {
template.print(current.description);
}
This prints the long description only when the short description contains "application related request".
Please Accept the solution if it assisted you with your question & Mark this response as Helpful.