Need a help on notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 02:34 AM - edited 11-10-2023 02:36 AM
Hi all,
We need a help on approval notification which is sent to now mobile app, currently in the notification we have all the variables shown but we need to restrict the variable[hide variables] if it has empty values or if checkbox is false. Please help!!
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 02:55 AM
Hi @William08 ,
You can write email script and by sending values from notification to email script and manipulate in email script and return to notification
(function runMailScript(current, template, email, email_action, event) {
if (current.getTableName() == 'incident') {
template.print('<div><p class="Approval">Approval Details:</p>');
if (current.caller_id.getDisplayValue()) {
template.print('<p class="normal">Caller: ' + current.caller_id.getDisplayValue() + '</p>');
}
if (current.caller_id.email) {
template.print('<p class="normal">Email: ' + current.caller_id.email + '</p>');
}
if (current.description) {
template.print('<p class="normal">Description: ' + current.description + '</p>');
}
template.print('</div>');
}
})();
In notification body call email script-${mail_script:yourmailscriptname}
Please mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 04:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 03:13 AM
Please share screenshot where is this required
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 03:14 AM
is this for normal email notification? if yes then please share how the variables are currently included in email body.
Is it via email script or included directly?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader