Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

how create schedule to trigger notification expiry for due or over due using flow designer

Arun_Manoj
Mega Sage

hi,

 

I need a help , how to create the schedule to trigger notification expiry for due or over due using flow designer,

how the fetch the record and condition for the day (eg:7 days or 7days overdue) how to calculate those condition. How to trigger the event trigger notification.

 

7 REPLIES 7

Rafael Batistot
Kilo Patron

Hi @Arun_Manoj 

 

An option is use schedule job periodically 

 

See the Ankur answer 

 

https://www.servicenow.com/community/developer-forum/how-to-set-up-periodic-schedule-jobs/m-p/165651...

If you found this response helpful, please mark it as Helpful. If it fully answered your question, consider marking it as Correct. Doing so helps other users find accurate and useful information more easily.

RaghavSh
Mega Patron

This can be done with schedule job but with flow, try below:

 

Create a flow designer and "Add Trigger" as "Schedule". Select the schedule as per your requiremnt.

Then you need to create an action and call it in your flow after the trigger.

 

Example of script from incident table:

var equery  ="due_date<javascript&colon;gs.beginningOfLast7Days()" ; // 7 days ago
var equery  ="due_dateBETWEENjavascript&colon;gs.beginningOfToday()@javascript&colon;gs.endOfNextWeek()" ; // 7 days ago
var inc = new GlideRecord('incident');
inc.addEncodedQuery(equery);
inc.query();
while(inc.next()){
gs.eventQueue('event_name' , current , inc.called_id); // create a event in event registry and add here.
}

 

After this create a notification and the trigger of the notification should be the even create above.


Raghav
MVP 2023
LinkedIn

Ankur Bawiskar
Tera Patron
Tera Patron

@Arun_Manoj 

so what did you start with and where are you stuck?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Bhuvan
Giga Patron

@Arun_Manoj 

 

Try using below,

 

https://www.servicenow.com/community/developer-articles/date-difference-in-flow-designer/ta-p/229620...

 

Once you have the custom action, you can can compare the duration condition and if it evaluates to true, you can trigger notification action

 

If this helped to answer your query, please mark it helpful & accept the solution. 

 

Thanks,

Bhuvan