- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2020 01:27 AM
Hello!
I have a notification running on the sc_task table. I want to display the due date field from the RITM to the notification.
I can do this by dot walk. However, I only want to display the date section (bold part from the sample) of the value.
Due date: 2020-12-15 16:00:00 PST
Is this possible?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2020 01:37 AM
You will require to handle this via email script
Then include that email script in your notification body using ${mail_script:mailScriptName}
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var gdt = new GlideDateTime(current.request_item.due_date);
var date = gdt.getLocalDate();
template.print('Date'+ date);
})(current, template, email, email_action, event);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2020 01:37 AM
Hi,
On the Notification Email Script, you can take like this.
var gdt_duedate = new GlideDateTime(current.<duedate variable>);
var gd_duedate = new GlideDate();
gd_duedate.setValue(gdt_duedate);
var onlydate = gd_duedate.getByFormat("MM/dd/yyyy").toString();
Please mark it as correct answer if your issue resolves.
Thanks,
Narsing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2020 01:37 AM
You will require to handle this via email script
Then include that email script in your notification body using ${mail_script:mailScriptName}
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var gdt = new GlideDateTime(current.request_item.due_date);
var date = gdt.getLocalDate();
template.print('Date'+ date);
})(current, template, email, email_action, event);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader