- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2023 10:47 PM
Hello everyone,
We have a notification for the Change Request table that requires a modification. In the email body, the CAB Date field should be displayed in MM DD YYYY format exclusively for this notification. Currently, it is showing in the YYYY MM DD format.
Please refer to the screenshot below for more information. Can anyone please assist me with this?
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2023 11:06 PM - edited ‎11-09-2023 11:17 PM
Hi @Aditya37 ,
Create an email script and write below script
var cabdate = new GlideDateTime('replacewith out date field');
var fd = new GlideDateTime(cabdate);
var dateToPrint = fd.getDate();
var get = dateToPrint.getByFormat('MM-dd-yyyy');
template.print(get);
In notification body-------------
${mail_script:mailscriptname}
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-09-2023 11:14 PM
you will require email script for this and then include that email script in email body
I hope you know how to create email script and include in email body syntax is ${mail_script:mailScriptName}
Check on docs if any query
In email script do this
var cabDt = new GlideDateTime(current.cab_date_time);
var dt = new GlideDate(cabDt.getDate());
var myFormatValue = dt.getByFormat('MM-dd-yyyy');
template.print('See below for the status of CAB date: ' + myFormatValue);
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
‎11-09-2023 11:06 PM - edited ‎11-09-2023 11:17 PM
Hi @Aditya37 ,
Create an email script and write below script
var cabdate = new GlideDateTime('replacewith out date field');
var fd = new GlideDateTime(cabdate);
var dateToPrint = fd.getDate();
var get = dateToPrint.getByFormat('MM-dd-yyyy');
template.print(get);
In notification body-------------
${mail_script:mailscriptname}
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 01:46 AM
Thank you for the quick response.
Thank you so much for your help! Your solution was perfect and exactly what I needed. I appreciate your expertise.
Thanks😊!
Thank You!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2023 11:14 PM
you will require email script for this and then include that email script in email body
I hope you know how to create email script and include in email body syntax is ${mail_script:mailScriptName}
Check on docs if any query
In email script do this
var cabDt = new GlideDateTime(current.cab_date_time);
var dt = new GlideDate(cabDt.getDate());
var myFormatValue = dt.getByFormat('MM-dd-yyyy');
template.print('See below for the status of CAB date: ' + myFormatValue);
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
‎11-10-2023 01:53 AM - edited ‎11-10-2023 01:56 AM
Thanks for the quick response.
Your solution was exactly what I needed, and I can't thank you enough for your assistance. Your expertise is greatly valued!
Thanks😊!