Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

dynamic duration in flow designer

juan casas
Mega Expert

Hi experts

 

I have a 'Date/time' field called 'Deadline'

I want to make a mechanism that when the system's time reaches the 'deadline', a notification is triggered.

 

the first time I did this, was with a scheduled script, but I realized that I could not use that because it requires a time to run. and that wont work since the deadline is dynamic and can be 2 hours or 2 months.

 

So I started to make a flow but I was not sure if I should create a sla for this or something.

 

what is the best approach for this configuration?

1 ACCEPTED SOLUTION

Kieran Anson
Kilo Patron

Hi Juan,

With it sounding like a notification need to go out the second the deadline passes, an SLA definition would be the best approach as it'll provide the ability to trigger a notification within a few seconds of the time passing, it'll also handle if the deadline value changes.

Create a new cmn_relative_duration based on the existing "breach on due date" replacing it with your custom field name

View solution in original post

2 REPLIES 2

Kieran Anson
Kilo Patron

Hi Juan,

With it sounding like a notification need to go out the second the deadline passes, an SLA definition would be the best approach as it'll provide the ability to trigger a notification within a few seconds of the time passing, it'll also handle if the deadline value changes.

Create a new cmn_relative_duration based on the existing "breach on due date" replacing it with your custom field name

Mohith Devatte
Tera Sage
Tera Sage

Hello @juan casas ,

you can try this 

 

var dt = new GlideDateTime();
gs.eventQueueScheduled("incident.event.at_2", current, "", "", dt);

with this you can schedule an event

please mark my answer correct if it helps you