How to customize notification email subject with dynamic date/time in ServiceNow OHS Incident table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi Community,
I am working on a Health and Safety catalog item in ServiceNow.
When a user submits the catalog item from the Service Portal, an incident record is created in the sn_ohs_im_incident table, and a notification email is triggered.
I need to customize the email subject dynamically.
Currently, I want the subject to be in the following format:
Tuesday, September 1, 2026 1:30 PM
Where:
Tuesday, September 1, 2026 1:30 PM → dynamic date/time from the incident record
I tried using notification variables such as ${number} and ${sys_created_on}, but I need the date/time in this exact format:
Day of Week, Month DD, YYYY H:MM AM/PM
For example:
Tuesday, September 1, 2026 1:30 PM
Questions:
What is the recommended way to achieve this in a ServiceNow Notification?
Should I use a Mail Script to format sys_created_on?
Is there a better approach using a Script Include or a field on sn_ohs_im_incident?
How can I ensure the date/time respects the user's/time zone's expected display format?
Any guidance or sample code would be appreciated.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
46m ago
It sounds like a mail script to me but before that... your description seems contradictory - you say the day/time has to be in that exact format but then you want to ensure that it respects the user's display format. How can it be both if the user has picked anything other than the one you stated ?
