- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2025 09:41 PM
I have notification which trigger based on case variables.
Requirement is , if value is blank for any field value configured in email body it should come as "Not Application".
How to achieve it?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2025 11:00 PM
Hello @Hafsa1
For your requirement you can write script as below:
// Check Requestor Name
var requestorName = (current.contact_name_1.nil() && current.contact_name_2.nil() && current.contact_name_3.nil()) ? "Not Application" : (current.contact_name_1 || current.contact_name_2 || current.contact_name_3);
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2025 10:06 PM
please share some details
1) how are you sending email?
2) email notification is on which table?
3) are you using some script? if yes then you will have to use email script and check if variable value is blank then print "Not Application"
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
01-19-2025 10:20 PM
Hello @Hafsa1
The notification you are sending is it using direct variables over email body? If yes, to achieve this in ServiceNow, you can use email scripts to check if a field value is blank and replace it with "Not Application" in the email body.
You can check about email scripting in notification over this link - Example scripting for email notifications
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2025 11:00 PM
Hello @Hafsa1
For your requirement you can write script as below:
// Check Requestor Name
var requestorName = (current.contact_name_1.nil() && current.contact_name_2.nil() && current.contact_name_3.nil()) ? "Not Application" : (current.contact_name_1 || current.contact_name_2 || current.contact_name_3);
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2025 10:50 PM
it is in table "sysapproval_approver".
on RP, we have created 3 separate variable sets. Based on condition variable sets populate. At one point of time only 1 variable set can populate and user will fill values based on country. I have added common variables from each variable set as below. but in some case if all 3 variables are blank i want it to give "Not applicable" as text instead on blank.
Requestor name |
${sysapproval.contact_name_1} |
Requestor email | ${sysapproval.variables.email_address_for_ordering_1} ${sysapproval.variables.email_address_for_ordering_2} ${sysapproval.variables.email_address_for_ordering_3} |
Attach documentation |
${sysapproval.variables.u_attach_documentation_1} |
Attach screening documentation | ${sysapproval.variables.attach_screening_documentation_1} |