- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 05:22 PM
Hello,
I need to change the date format that is part of a notification so that it shows as MM/dd/yyyy. On the screen shot below, my script is making the notification show "Opened:" two times and then the date for the second one is formatted correctly, but one a new line instead of the same line. Can someone take a look at my script below and tell what I am missing here please?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 05:57 PM
Hi @Annette Kitzmil ,
I think in the notification body you would have written Opened: followed by email script.
I would suggest remove Opened either at notification body or in the email script as of template.print
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 07:19 PM - edited 03-20-2024 08:08 PM
HI @Annette Kitzmil check in your email body do you have extra word opened By. You can use the below script directly,
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 05:30 AM
Thank you, I really appreciate it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2024 07:58 PM
Please try below code:
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var dateToPrint = new GlideDateTime(current.opened_at);
var dateFormat = dateToPrint.getDate();
template.print('<p>Opened: ' + dateFormat.getByFormat('MM/dd/yyyy') + '</p>');
})(current, template, email, email_action, event);
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks