We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How To Put Scripted Timer In Flow Designer?

siva44
Tera Contributor

Hi Everyone,

I have the one workflow for leaver employees so in workflow one timer activity through script  is there  now I am creating that workflow into flow so how to put that timer activity in flow desginer?
Timer script in workflow:

 

var leaverdate = new GlideDateTime();  
    leaverdate.setDisplayValue(current.variables.last_day.getDisplayValue());  

//convert last_day value to millisecond value    
var leaverdateValue = leaverdate.getNumericValue();

//get current date/time in MS
var dateobj = new Date();
    var dateObject = new Date(dateobj.getTime() + (dateobj.getTimezoneOffset() * 60000));
        var currentDateMS = (dateobj.getTime() + (dateobj.getTimezoneOffset() * 60000));

//calculate difference in seconds and add 86400 for the day after
answer = (((leaverdateValue - currentDateMS)/1000) + 86400);
3 REPLIES 3

Hayo Lubbers
Kilo Sage

Hi @siva44 ,

 

Have a look at the 'wait for' functionality in the flow logic of the flow designer. Here you can specify the duration you want to wait.

https://docs.servicenow.com/bundle/xanadu-build-workflows/page/administer/flow-designer/concept/flow...

vermaamit16
Kilo Patron

Hi @siva44 

 

Wait for a duration flow logic is the equivalent of timer activity in flow. Refer below post to understand it better

https://docs.servicenow.com/bundle/washingtondc-build-workflows/page/administer/flow-designer/concep...

 

Thanks and Regards

Amit Verma

Thanks and Regards
Amit Verma

@siva44 

 

You can even refer below post which could be helpful for your requirement :

https://www.servicenow.com/community/developer-forum/wait-for-duration-in-flow-designer/m-p/2501718

 

Thanks and Regards
Amit Verma