- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2023 04:32 AM
Hello Experts
We have field called type Date/time "Access end Time." ,Now we are resuming the workflow next activity based on field date/time value; now we want to send a notification after 5 minutes and before 20 Minutes .How can we achieve this requirement
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2023 06:08 AM
you can use eventQueueScheduled method and schedule your email
I hope you have the understanding on how to create event, link notification with event. You just need to trigger the event based on your time. The event will be processed at that time which you pass in gdt
1) have run script in your workflow and use this to trigger email after 5mins from current date/time
var gdt = new GlideDateTime(current.<dueDateField>);
gdt.addSeconds(300);
gs.eventQueueScheduled('eventName, current, '<yourRecipientList>', '', gdt);
2) in same run script in your workflow use this to trigger before 20mins from due date
var gdt = new GlideDateTime();
gdt.addSeconds(-1200); // 20 mins is 1200 seconds and since you want to send before we are using - negative
gs.eventQueueScheduled('approval.reminder', current, '<yourRecipientList>', '', gdt);
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
02-27-2023 07:02 AM
yes you can trigger email at particular time using that function.
I responded to your question for 5mins and 20mins
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader