Send Email Periodically 1 Hour for specific Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi, I have requirement to send email by using Scheduled Email Report every 1 hours but specifically between office hour 8AM until 8PM daily. Anyone can provide script or guidance on how to fulfill this requirement?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
you can give starting time as 8AM
In condition add this script so that it's sent only between 8am to 8pm every hour
// ServiceNow script to check if current time is between 8 AM and 8 PM
var now = new GlideDateTime();
var timeStr = now.getDisplayValue(); // Format: '2026-01-14 15:30:00'
var parts = timeStr.split(' ')[1].split(':'); // Extract '15:30:00' -> ['15','30','00']
var hour = parseInt(parts[0], 10);
answer = (hour >= 8 && hour < 20);
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hope you are doing good.
Did my reply answer your question?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday - last edited yesterday
Im implementing your code but change to hour < 13. I will let you know if the code is working (email stop at 1pm)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
No worries
but you must have tested it in background script if it gives correct hour etc?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
