- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2021 06:54 AM
In a table I had a field "Due Date" now suppose
-> When due is approaching in 30 days I need to trigger a notification...
-> and when due date is approaching in 15 days again need to trigger a notification..
Is it possible by using flow designer? if so can anyone help me please...I am not getting how to set the condition to calculate 30 and 15 days using flow designer...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2021 07:36 AM
Hi Sathwik,
Hope you are safe and good.
You can try this with scheduled jobs.
- Create an event in the registry.
- Create a Scheduled script execution which runs daily at 0800 hrs.
var chg_req=new GlideRecord('change_request');
chg_req.addEncodedQuery('active=true^due_dateRELATIVEGT@dayofweek@ahead@29^due_dateRELATIVELT@dayofweek@ahead@31^NQdue_dateRELATIVEGT@dayofweek@ahead@14^due_dateRELATIVELT@dayofweek@ahead@16');
chg_req.query();
if(chg_req.hasNext())
{
while(chg_req.next())
{
gs.eventQueue('change_request.schedule_reminder',gr,gr.assigned_to.email,'');
}
}
3. Create notification which sends the notification when the event got triggered.
In this example I have used Change Request table. Replace the table name in the glide record also due_date field name.
Please click on helpful if it is.
Thanks & Regards,
Sharath Allam
Kaptius - ServiceNow Premier Partner.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2021 07:49 AM
Because if we choose only after 30 days, it will pick records with due date in 30 or 31 or 32 or .... days. So to restrict to exactly 30 days, after 29 days and before 31 days.
Please click on "helpful".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2021 07:55 AM
Thank you so much...but a small doubt...
if(chg_req.hasNext()) -> why this was used? // I am aware that it will move to next record but why here it was used?
please explain this one
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2021 07:58 AM
Just to check any records are fetched or not?
hasNext() will check if there is a next record but doesn't move to next record.
Could you please mark the solution as 'accepted solution'.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2021 08:07 AM
Ohh ok,
suppose based on encoded query..
If I got "0" records then it will not enter into while loop..
else if I got atleast one record then it will proceed into next right?
please let me know if I am wrong thank you..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2021 08:16 AM
Yes Sathwik,
You are right.
Please mark my answer as "Correct Answer".
Thank you.